-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/microsoft/TeamCloud
- Loading branch information
Showing
19 changed files
with
167 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/TeamCloud.Azure.Deployment/Providers/NullStorageArtifactsProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. | ||
* Licensed under the MIT License. | ||
*/ | ||
|
||
using System; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace TeamCloud.Azure.Deployment.Providers | ||
{ | ||
public sealed class NullStorageArtifactsProvider : AzureDeploymentArtifactsProvider | ||
{ | ||
public static readonly IAzureDeploymentArtifactsProvider Instance = new NullStorageArtifactsProvider(); | ||
|
||
public override Task<string> DownloadArtifactAsync(Guid deploymentId, string artifactName) | ||
=> Task.FromResult(default(string)); | ||
|
||
public override Task<IAzureDeploymentArtifactsContainer> UploadArtifactsAsync(Guid deploymentId, AzureDeploymentTemplate azureDeploymentTemplate) | ||
=> (azureDeploymentTemplate?.LinkedTemplates.Any() ?? false) | ||
? Task.FromException<IAzureDeploymentArtifactsContainer>(new NotSupportedException($"{nameof(NullStorageArtifactsProvider)} doesn't support linked templates or artifacts")) | ||
: Task.FromResult<IAzureDeploymentArtifactsContainer>(Container.Instance); | ||
|
||
internal sealed class Container : IAzureDeploymentArtifactsContainer | ||
{ | ||
public static readonly IAzureDeploymentArtifactsContainer Instance = new Container(); | ||
|
||
public string Location => default(string); | ||
|
||
public string Token => default(string); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/TeamCloud.Azure.Resources/Templates/AzureResourceGroupCleanupTemplate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. | ||
* Licensed under the MIT License. | ||
*/ | ||
|
||
using TeamCloud.Azure.Deployment.Templates; | ||
|
||
namespace TeamCloud.Azure.Resources.Templates | ||
{ | ||
public sealed class AzureResourceGroupCleanupTemplate : EmbeddedDeploymentTemplate | ||
{ } | ||
} |
8 changes: 8 additions & 0 deletions
8
src/TeamCloud.Azure.Resources/Templates/AzureResourceGroupCleanupTemplate.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { }, | ||
"variables": { }, | ||
"resources": [ ], | ||
"outputs": { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/TeamCloud.Http/Telemetry/TeamCloudTelemetryInitializer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Reflection; | ||
using Microsoft.ApplicationInsights.Channel; | ||
using Microsoft.ApplicationInsights.Extensibility; | ||
|
||
namespace TeamCloud.Http.Telemetry | ||
{ | ||
public sealed class TeamCloudTelemetryInitializer : ITelemetryInitializer | ||
{ | ||
private readonly Assembly assembly; | ||
|
||
internal TeamCloudTelemetryInitializer(Assembly assembly) | ||
{ | ||
this.assembly = assembly ?? throw new System.ArgumentNullException(nameof(assembly)); | ||
} | ||
|
||
public void Initialize(ITelemetry telemetry) | ||
{ | ||
if (telemetry is null) | ||
throw new System.ArgumentNullException(nameof(telemetry)); | ||
|
||
if (string.IsNullOrEmpty(telemetry.Context.Cloud.RoleName)) | ||
telemetry.Context.Cloud.RoleName = assembly.GetName().Name; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters