1616using BuildXL . Cache . Monitor . App . Rules ;
1717using BuildXL . Cache . Monitor . App . Rules . Kusto ;
1818using BuildXL . Cache . Monitor . App . Scheduling ;
19- using BuildXL . Cache . Monitor . Library . IcM ;
2019using BuildXL . Cache . Monitor . Library . Notifications ;
2120using BuildXL . Cache . Monitor . Library . Rules . Kusto ;
2221using BuildXL . Cache . Monitor . Library . Scheduling ;
@@ -31,16 +30,6 @@ public class Configuration
3130 {
3231 public KustoCredentials KustoIngestionCredentials { get ; set ; } = Constants . CloudBuildProdKustoCredentials ;
3332
34- public string KeyVaultUrl { get ; set ; } = Constants . DefaultKeyVaultUrl ;
35-
36- public AzureActiveDirectoryCredentials KeyVaultCredentials { get ; set ; } = Constants . PMETenantCredentials ;
37-
38- public string IcmUrl { get ; set ; } = Constants . DefaultIcmUrl ;
39-
40- public Guid IcmConnectorId { get ; set ; } = Constants . DefaultIcmConnectorId ;
41-
42- public string IcmCertificateName { get ; set ; } = Constants . DefaultIcmCertificateName ;
43-
4433 public bool ReadOnly { get ; set ; } = true ;
4534
4635 /// <summary>
@@ -92,7 +81,6 @@ public class Configuration
9281 private readonly IReadOnlyDictionary < MonitorEnvironment , EnvironmentResources > _environmentResources ;
9382
9483 private readonly IKustoIngestClient _kustoIngestClient ;
95- private readonly IIcmClient _icmClient ;
9684
9785 private static Tracer Tracer { get ; } = new Tracer ( nameof ( Monitor ) ) ;
9886
@@ -102,39 +90,12 @@ public static async Task<Result<Monitor>> CreateAsync(OperationContext context,
10290 Tracer . Info ( context , "Creating Kusto ingest client" ) ;
10391 var kustoIngestClient = ExternalDependenciesFactory . CreateKustoIngestClient ( configuration . KustoIngestionCredentials ) . ThrowIfFailure ( ) ;
10492
105- IIcmClient icmClient ;
106- if ( ! configuration . ReadOnly )
107- {
108- Tracer . Info ( context , "Creating KeyVault client" ) ;
109- var keyVaultClient = new KeyVaultClient (
110- configuration . KeyVaultUrl ,
111- configuration . KeyVaultCredentials . TenantId ,
112- configuration . KeyVaultCredentials . AppId ,
113- configuration . KeyVaultCredentials . AppKey ,
114- SystemClock . Instance ,
115- Constants . IcmCertificateCacheTimeToLive ) ;
116-
117- Tracer . Info ( context , "Creating IcM client" ) ;
118- icmClient = new IcmClient (
119- keyVaultClient ,
120- configuration . IcmUrl ,
121- configuration . IcmConnectorId ,
122- configuration . IcmCertificateName ,
123- SystemClock . Instance ) ;
124- }
125- else
126- {
127- Tracer . Info ( context , "Using mock ICM client" ) ;
128- icmClient = new MockIcmClient ( ) ;
129- }
130-
13193 var environmentResources = await CreateEnvironmentResourcesAsync ( context , configuration . Environments ) ;
13294
13395 context . Token . ThrowIfCancellationRequested ( ) ;
13496 return new Monitor (
13597 configuration ,
13698 kustoIngestClient ,
137- icmClient ,
13899 SystemClock . Instance ,
139100 environmentResources ,
140101 context . TracingContext . Logger ) ;
@@ -171,14 +132,13 @@ private static Task<EnvironmentResources> CreateEnvironmentResourcesAsync(Operat
171132 return Task . FromResult ( new EnvironmentResources ( kustoClient ) ) ;
172133 }
173134
174- private Monitor ( Configuration configuration , IKustoIngestClient kustoIngestClient , IIcmClient icmClient , IClock clock , IReadOnlyDictionary < MonitorEnvironment , EnvironmentResources > environmentResources , ILogger logger )
135+ private Monitor ( Configuration configuration , IKustoIngestClient kustoIngestClient , IClock clock , IReadOnlyDictionary < MonitorEnvironment , EnvironmentResources > environmentResources , ILogger logger )
175136 {
176137 _configuration = configuration ;
177138
178139 _clock = clock ;
179140 _logger = logger ;
180141 _kustoIngestClient = kustoIngestClient ;
181- _icmClient = icmClient ;
182142 _environmentResources = environmentResources ;
183143
184144 if ( configuration . ReadOnly )
@@ -412,7 +372,6 @@ private void OncePerStamp(Func<SingleStampRuleArguments, IEnumerable<Instantiati
412372 _logger ,
413373 _alertNotifier ,
414374 resources . KustoQueryClient ,
415- _icmClient ,
416375 environmentConfiguration . KustoDatabaseName ,
417376 stampId ) ;
418377
@@ -446,7 +405,6 @@ private void OncePerEnvironment(Func<MultiStampRuleArguments, IEnumerable<Instan
446405 _logger ,
447406 _alertNotifier ,
448407 resources . KustoQueryClient ,
449- _icmClient ,
450408 _configuration . Environments [ environment ] . KustoDatabaseName ,
451409 environment ,
452410 watchlist ) ;
0 commit comments