From ecb64e9e95c2de2ee85e3b217a108d3f317fe1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Fri, 12 Dec 2025 07:52:33 +0100 Subject: [PATCH 1/9] Minor cleanup --- .../AzureQuery.cs | 56 +++++++++---------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/src/ServiceControl.Transports.ASBS/AzureQuery.cs b/src/ServiceControl.Transports.ASBS/AzureQuery.cs index 3007ed7374..47af6c4518 100644 --- a/src/ServiceControl.Transports.ASBS/AzureQuery.cs +++ b/src/ServiceControl.Transports.ASBS/AzureQuery.cs @@ -145,12 +145,7 @@ protected override void InitializeCore(ReadOnlyDictionary settin (ArmEnvironment armEnvironment, MetricsClientAudience metricsClientAudience) GetEnvironment() { - if (managementUrlParsed == null) - { - return (ArmEnvironment.AzurePublicCloud, MetricsClientAudience.AzurePublicCloud); - } - - if (managementUrlParsed == ArmEnvironment.AzurePublicCloud.Endpoint) + if (managementUrlParsed == null || managementUrlParsed == ArmEnvironment.AzurePublicCloud.Endpoint) { return (ArmEnvironment.AzurePublicCloud, MetricsClientAudience.AzurePublicCloud); } @@ -175,7 +170,7 @@ protected override void InitializeCore(ReadOnlyDictionary settin { ArmEnvironment.AzurePublicCloud, ArmEnvironment.AzureGermany, ArmEnvironment.AzureGovernment, ArmEnvironment.AzureChina - }.Select(armEnvironment => $"\"{armEnvironment.Endpoint}\"")); + }.Select(environment => $"\"{environment.Endpoint}\"")); InitialiseErrors.Add($"Management url configuration is invalid, available options are {options}"); return (ArmEnvironment.AzurePublicCloud, MetricsClientAudience.AzurePublicCloud); @@ -202,7 +197,7 @@ public string ExtractServiceBusName() public override async IAsyncEnumerable GetThroughputPerDay(IBrokerQueue brokerQueue, DateOnly startDate, - [EnumeratorCancellation] CancellationToken cancellationToken = default) + [EnumeratorCancellation] CancellationToken cancellationToken) { logger.LogInformation($"Gathering metrics for \"{brokerQueue.QueueName}\" queue"); @@ -298,30 +293,32 @@ async Task> GetMetrics(string queueName, DateOnly sta } public override async IAsyncEnumerable GetQueueNames( - [EnumeratorCancellation] CancellationToken cancellationToken = default) + [EnumeratorCancellation] CancellationToken cancellationToken) { var validNamespaces = await GetValidNamespaceNames(cancellationToken); SubscriptionResource? subscription = await armClient!.GetDefaultSubscriptionAsync(cancellationToken); var namespaces = subscription.GetServiceBusNamespacesAsync(cancellationToken); - await foreach (var serviceBusNamespaceResource in namespaces.WithCancellation(cancellationToken)) + await foreach (var serviceBusNamespaceResource in namespaces) { - if (validNamespaces.Contains(serviceBusNamespaceResource.Data.Name)) + if (!validNamespaces.Contains(serviceBusNamespaceResource.Data.Name)) { - resourceId = serviceBusNamespaceResource.Id; + continue; + } - await foreach (var queue in serviceBusNamespaceResource.GetServiceBusQueues() - .WithCancellation(cancellationToken)) - { - yield return new DefaultBrokerQueue(queue.Data.Name); - } + resourceId = serviceBusNamespaceResource.Id; - yield break; + await foreach (var queue in serviceBusNamespaceResource.GetServiceBusQueues() + .WithCancellation(cancellationToken)) + { + yield return new DefaultBrokerQueue(queue.Data.Name); } + + yield break; } - throw new Exception($"Could not find a ServiceBus named \"{serviceBusName}\""); + throw new Exception($"Could not find a Azure Service Bus namespace named \"{serviceBusName}\""); } // ArmEnvironment Audience Values: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/src/ArmEnvironment.cs @@ -338,12 +335,9 @@ async Task> GetValidNamespaceNames(CancellationToken cancellatio { var validNamespaces = new HashSet(StringComparer.OrdinalIgnoreCase) { serviceBusName }; - if (!ServiceBusDomains.TryGetValue(armEnvironment, out var serviceBusCloudDomain)) - { - // Worst case: the DNS lookup finds nothing additional to match - serviceBusCloudDomain = "servicebus.windows.net"; - } + var serviceBusCloudDomain = ServiceBusDomains.GetValueOrDefault(armEnvironment, "servicebus.windows.net"); + // Worst case: the DNS lookup finds nothing additional to match var queryDomain = $"{serviceBusName}.{serviceBusCloudDomain}"; var validDomainTail = $".{serviceBusCloudDomain}."; @@ -365,12 +359,12 @@ async Task> GetValidNamespaceNames(CancellationToken cancellatio public override KeyDescriptionPair[] Settings => [ - new KeyDescriptionPair(AzureServiceBusSettings.ServiceBusName, AzureServiceBusSettings.ServiceBusNameDescription), - new KeyDescriptionPair(AzureServiceBusSettings.ClientId, AzureServiceBusSettings.ClientIdDescription), - new KeyDescriptionPair(AzureServiceBusSettings.ClientSecret, AzureServiceBusSettings.ClientSecretDescription), - new KeyDescriptionPair(AzureServiceBusSettings.TenantId, AzureServiceBusSettings.TenantIdDescription), - new KeyDescriptionPair(AzureServiceBusSettings.SubscriptionId, AzureServiceBusSettings.SubscriptionIdDescription), - new KeyDescriptionPair(AzureServiceBusSettings.ManagementUrl, AzureServiceBusSettings.ManagementUrlDescription) + new(AzureServiceBusSettings.ServiceBusName, AzureServiceBusSettings.ServiceBusNameDescription), + new(AzureServiceBusSettings.ClientId, AzureServiceBusSettings.ClientIdDescription), + new(AzureServiceBusSettings.ClientSecret, AzureServiceBusSettings.ClientSecretDescription), + new(AzureServiceBusSettings.TenantId, AzureServiceBusSettings.TenantIdDescription), + new(AzureServiceBusSettings.SubscriptionId, AzureServiceBusSettings.SubscriptionIdDescription), + new(AzureServiceBusSettings.ManagementUrl, AzureServiceBusSettings.ManagementUrlDescription) ]; protected override async Task<(bool Success, List Errors)> TestConnectionCore( @@ -405,4 +399,4 @@ public static class AzureServiceBusSettings public static readonly string ManagementUrl = "ASB/ManagementUrl"; public static readonly string ManagementUrlDescription = "Azure management URL"; } -} +} \ No newline at end of file From e68e0a5b4c144f5c8c2c2fcfd92e9011ee539676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Fri, 12 Dec 2025 09:02:25 +0100 Subject: [PATCH 2/9] Better error message --- src/ServiceControl.Transports.ASBS/AzureQuery.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ServiceControl.Transports.ASBS/AzureQuery.cs b/src/ServiceControl.Transports.ASBS/AzureQuery.cs index 47af6c4518..6cce394326 100644 --- a/src/ServiceControl.Transports.ASBS/AzureQuery.cs +++ b/src/ServiceControl.Transports.ASBS/AzureQuery.cs @@ -238,7 +238,7 @@ async Task InitializeMetricsClient(CancellationToken cancellation var serviceBusNamespaceResource = await armClient .GetServiceBusNamespaceResource(resourceId).GetAsync(cancellationToken) - ?? throw new Exception($"Could not find ServiceBus with resource Id: \"{resourceId}\""); + ?? throw new Exception($"Could not find an Azure Service Bus namespace with resource Id: \"{resourceId}\""); // Determine the region of the namespace var regionName = serviceBusNamespaceResource.Value.Data.Location.Name; From 424eae543b4b5d172c3546d464c8f7eee3e32195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Fri, 12 Dec 2025 09:04:00 +0100 Subject: [PATCH 3/9] Azure Service Bus namespace --- src/ServiceControl.Transports.ASBS/AzureQuery.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ServiceControl.Transports.ASBS/AzureQuery.cs b/src/ServiceControl.Transports.ASBS/AzureQuery.cs index 6cce394326..931ea3a93b 100644 --- a/src/ServiceControl.Transports.ASBS/AzureQuery.cs +++ b/src/ServiceControl.Transports.ASBS/AzureQuery.cs @@ -56,12 +56,12 @@ protected override void InitializeCore(ReadOnlyDictionary settin { // Extract ServiceBus name from connection string serviceBusName = ExtractServiceBusName(); - logger.LogInformation("ServiceBus name extracted from connection string"); - Diagnostics.AppendLine($"ServiceBus name not set, defaulted to \"{serviceBusName}\""); + logger.LogInformation("Azure Service Bus namespace name extracted from connection string"); + Diagnostics.AppendLine($"Azure Service Bus namespace not set, defaulted to \"{serviceBusName}\""); } else { - Diagnostics.AppendLine($"ServiceBus name set to \"{serviceBusName}\""); + Diagnostics.AppendLine($"Azure Service Bus namespace set to \"{serviceBusName}\""); } if (!settings.TryGetValue(AzureServiceBusSettings.SubscriptionId, out string? subscriptionId)) From 1836daf8fd67f9c8d022bc3fd1f2e66b7a5307e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Fri, 12 Dec 2025 09:09:25 +0100 Subject: [PATCH 4/9] Improved error management --- .../AzureQuery.cs | 57 ++++++++++++------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/src/ServiceControl.Transports.ASBS/AzureQuery.cs b/src/ServiceControl.Transports.ASBS/AzureQuery.cs index 931ea3a93b..3d871bd43c 100644 --- a/src/ServiceControl.Transports.ASBS/AzureQuery.cs +++ b/src/ServiceControl.Transports.ASBS/AzureQuery.cs @@ -25,6 +25,9 @@ namespace ServiceControl.Transports.ASBS; public class AzureQuery(ILogger logger, TimeProvider timeProvider, TransportSettings transportSettings) : BrokerThroughputQuery(logger, "AzureServiceBus") { + const string CompleteMessageMetricName = "CompleteMessage"; + const string MicrosoftServicebusNamespacesMetricsNamespace = "Microsoft.ServiceBus/Namespaces"; + string serviceBusName = string.Empty; ArmClient? armClient; TokenCredential? credential; @@ -135,10 +138,7 @@ protected override void InitializeCore(ReadOnlyDictionary settin { Environment = armEnvironment, Transport = new HttpClientTransport( - new HttpClient(new SocketsHttpHandler - { - PooledConnectionIdleTimeout = TimeSpan.FromMinutes(2) - })) + new HttpClient(new SocketsHttpHandler { PooledConnectionIdleTimeout = TimeSpan.FromMinutes(2) })) }); return; @@ -166,11 +166,7 @@ protected override void InitializeCore(ReadOnlyDictionary settin } string options = string.Join(", ", - new[] - { - ArmEnvironment.AzurePublicCloud, ArmEnvironment.AzureGermany, ArmEnvironment.AzureGovernment, - ArmEnvironment.AzureChina - }.Select(environment => $"\"{environment.Endpoint}\"")); + new[] { ArmEnvironment.AzurePublicCloud, ArmEnvironment.AzureGermany, ArmEnvironment.AzureGovernment, ArmEnvironment.AzureChina }.Select(environment => $"\"{environment.Endpoint}\"")); InitialiseErrors.Add($"Management url configuration is invalid, available options are {options}"); return (ArmEnvironment.AzurePublicCloud, MetricsClientAudience.AzurePublicCloud); @@ -214,7 +210,11 @@ public override async IAsyncEnumerable GetThroughputPerDay(IBro var data = new Dictionary(); while (currentDate <= endDate) { - data.Add(currentDate, new QueueThroughput { TotalThroughput = 0, DateUTC = currentDate }); + data.Add(currentDate, new QueueThroughput + { + TotalThroughput = 0, + DateUTC = currentDate + }); currentDate = currentDate.AddDays(1); } @@ -237,8 +237,8 @@ async Task InitializeMetricsClient(CancellationToken cancellation } var serviceBusNamespaceResource = await armClient - .GetServiceBusNamespaceResource(resourceId).GetAsync(cancellationToken) - ?? throw new Exception($"Could not find an Azure Service Bus namespace with resource Id: \"{resourceId}\""); + .GetServiceBusNamespaceResource(resourceId).GetAsync(cancellationToken) + ?? throw new Exception($"Could not find an Azure Service Bus namespace with resource Id: \"{resourceId}\""); // Determine the region of the namespace var regionName = serviceBusNamespaceResource.Value.Data.Location.Name; @@ -254,10 +254,7 @@ async Task InitializeMetricsClient(CancellationToken cancellation { Audience = metricsClientAudience, Transport = new HttpClientTransport( - new HttpClient(new SocketsHttpHandler - { - PooledConnectionIdleTimeout = TimeSpan.FromMinutes(2) - })) + new HttpClient(new SocketsHttpHandler { PooledConnectionIdleTimeout = TimeSpan.FromMinutes(2) })) }); } @@ -276,8 +273,8 @@ async Task> GetMetrics(string queueName, DateOnly sta var response = await metricsClient.QueryResourcesAsync( [resourceId!], - ["CompleteMessage"], - "Microsoft.ServiceBus/namespaces", + [CompleteMessageMetricName], + MicrosoftServicebusNamespacesMetricsNamespace, new MetricsQueryResourcesOptions { Filter = $"EntityName eq '{queueName}'", @@ -286,10 +283,28 @@ async Task> GetMetrics(string queueName, DateOnly sta }, cancellationToken); - var metricValues = - response.Value.Values.FirstOrDefault()?.Metrics.FirstOrDefault()?.TimeSeries.FirstOrDefault()?.Values ?? []; + var metricQueryResult = response.Value.Values.SingleOrDefault(mr => mr.Namespace == MicrosoftServicebusNamespacesMetricsNamespace); + + if (metricQueryResult is null) + { + throw new Exception($"No metrics query results returned for {MicrosoftServicebusNamespacesMetricsNamespace}"); + } + + var metricResult = metricQueryResult.GetMetricByName(CompleteMessageMetricName); + + if (metricResult.Error.Message is not null) + { + throw new Exception($"Metrics query result for '{metricResult.Name}' failed: {metricResult.Error.Message}"); + } + + var timeSeries = metricResult.TimeSeries.SingleOrDefault(); + + if (timeSeries is null) + { + throw new Exception($"Metrics query result for '{metricResult.Name}' contained no time series"); + } - return metricValues.AsReadOnly(); + return timeSeries.Values.AsReadOnly(); } public override async IAsyncEnumerable GetQueueNames( From eb0cbb76e76fcc54c67f6cfb1d193c7185654c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Tue, 16 Dec 2025 16:46:17 +0100 Subject: [PATCH 5/9] Approvals --- ...AzureQueryTests.TestConnectionWithEmptySettings.approved.txt | 2 +- ...TestConnectionWithInvalidSubscriptionIdSettings.approved.txt | 2 +- ...yTests.TestConnectionWithInvalidTenantIdSetting.approved.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithEmptySettings.approved.txt b/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithEmptySettings.approved.txt index d8c4a461c8..d4539d26db 100644 --- a/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithEmptySettings.approved.txt +++ b/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithEmptySettings.approved.txt @@ -4,7 +4,7 @@ ClientId is a required setting ClientSecret is a required setting Connection attempted with the following settings: -ServiceBus name not set, defaulted to "testmenow" +Azure Service Bus namespace not set, defaulted to "testmenow" SubscriptionId not set, using the first found subscription TenantId not set ClientId not set diff --git a/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithInvalidSubscriptionIdSettings.approved.txt b/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithInvalidSubscriptionIdSettings.approved.txt index b241c39850..343ffe8868 100644 --- a/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithInvalidSubscriptionIdSettings.approved.txt +++ b/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithInvalidSubscriptionIdSettings.approved.txt @@ -2,7 +2,7 @@ Connection test to AzureServiceBus failed: The GUID for subscription is invalid not valid. Connection attempted with the following settings: -ServiceBus name not set, defaulted to "testmenow" +Azure Service Bus namespace not set, defaulted to "testmenow" SubscriptionId set TenantId set ClientId set diff --git a/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithInvalidTenantIdSetting.approved.txt b/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithInvalidTenantIdSetting.approved.txt index dd84fe3aaf..2d5ac0b1a7 100644 --- a/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithInvalidTenantIdSetting.approved.txt +++ b/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithInvalidTenantIdSetting.approved.txt @@ -2,7 +2,7 @@ Connection settings to AzureServiceBus have some errors: Invalid tenant id provided. You can locate your tenant id by following the instructions listed here: https://learn.microsoft.com/partner-center/find-ids-and-domain-names (Parameter 'tenantId') Connection attempted with the following settings: -ServiceBus name not set, defaulted to "testmenow" +Azure Service Bus namespace not set, defaulted to "testmenow" SubscriptionId set TenantId set ClientId set From ce03991d2d60bce589f73355511f7536fafbb020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Tue, 16 Dec 2025 17:47:54 +0100 Subject: [PATCH 6/9] More approvals --- ...Tests.TestConnectionWithInvalidClientIdSettings.approved.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithInvalidClientIdSettings.approved.txt b/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithInvalidClientIdSettings.approved.txt index 695cb9d6c6..a313ea6207 100644 --- a/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithInvalidClientIdSettings.approved.txt +++ b/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithInvalidClientIdSettings.approved.txt @@ -2,7 +2,7 @@ Connection test to AzureServiceBus failed: ClientSecretCredential authentication failed: AADSTS700016: Application with identifier 'not valid' was not found in the directory Connection attempted with the following settings: -ServiceBus name not set, defaulted to "testmenow" +Azure Service Bus namespace not set, defaulted to "testmenow" SubscriptionId set TenantId set ClientId set From 0348e082d5c103a82859e6f75d72bb20e6ffee4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Tue, 16 Dec 2025 18:02:36 +0100 Subject: [PATCH 7/9] More approvals --- ...stConnectionWithMissingLastSlashInManagementUrl.approved.txt | 2 +- ...AzureQueryTests.TestConnectionWithValidSettings.approved.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithMissingLastSlashInManagementUrl.approved.txt b/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithMissingLastSlashInManagementUrl.approved.txt index 7a2cbf50e5..f900980c82 100644 --- a/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithMissingLastSlashInManagementUrl.approved.txt +++ b/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithMissingLastSlashInManagementUrl.approved.txt @@ -1,7 +1,7 @@ Connection test to AzureServiceBus was successful Connection settings used: -ServiceBus name not set, defaulted to "xxxxx" +Azure Service Bus namespace not set, defaulted to "xxxxx" SubscriptionId set TenantId set ClientId set diff --git a/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithValidSettings.approved.txt b/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithValidSettings.approved.txt index fe56cfd545..d0bdbdcc2f 100644 --- a/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithValidSettings.approved.txt +++ b/src/ServiceControl.Transports.ASBS.Tests/ApprovalFiles/AzureQueryTests.TestConnectionWithValidSettings.approved.txt @@ -1,7 +1,7 @@ Connection test to AzureServiceBus was successful Connection settings used: -ServiceBus name not set, defaulted to "xxxxx" +Azure Service Bus namespace not set, defaulted to "xxxxx" SubscriptionId set TenantId set ClientId set From 44289c696b5af694f70de2bf1a2235bc83c0d146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Wed, 17 Dec 2025 12:52:45 +0100 Subject: [PATCH 8/9] Revert formatting --- src/ServiceControl.Transports.ASBS/AzureQuery.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ServiceControl.Transports.ASBS/AzureQuery.cs b/src/ServiceControl.Transports.ASBS/AzureQuery.cs index 3d871bd43c..862772c44e 100644 --- a/src/ServiceControl.Transports.ASBS/AzureQuery.cs +++ b/src/ServiceControl.Transports.ASBS/AzureQuery.cs @@ -138,7 +138,10 @@ protected override void InitializeCore(ReadOnlyDictionary settin { Environment = armEnvironment, Transport = new HttpClientTransport( - new HttpClient(new SocketsHttpHandler { PooledConnectionIdleTimeout = TimeSpan.FromMinutes(2) })) + new HttpClient(new SocketsHttpHandler + { + PooledConnectionIdleTimeout = TimeSpan.FromMinutes(2) + })) }); return; @@ -166,7 +169,10 @@ protected override void InitializeCore(ReadOnlyDictionary settin } string options = string.Join(", ", - new[] { ArmEnvironment.AzurePublicCloud, ArmEnvironment.AzureGermany, ArmEnvironment.AzureGovernment, ArmEnvironment.AzureChina }.Select(environment => $"\"{environment.Endpoint}\"")); + new[] + { + ArmEnvironment.AzurePublicCloud, ArmEnvironment.AzureGermany, ArmEnvironment.AzureGovernment, ArmEnvironment.AzureChina + }.Select(environment => $"\"{environment.Endpoint}\"")); InitialiseErrors.Add($"Management url configuration is invalid, available options are {options}"); return (ArmEnvironment.AzurePublicCloud, MetricsClientAudience.AzurePublicCloud); From d059271c9d2f29a5b24869117239890b2860e58a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Wed, 17 Dec 2025 12:54:59 +0100 Subject: [PATCH 9/9] Revert formatting --- src/ServiceControl.Transports.ASBS/AzureQuery.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ServiceControl.Transports.ASBS/AzureQuery.cs b/src/ServiceControl.Transports.ASBS/AzureQuery.cs index 862772c44e..a8c436a725 100644 --- a/src/ServiceControl.Transports.ASBS/AzureQuery.cs +++ b/src/ServiceControl.Transports.ASBS/AzureQuery.cs @@ -260,7 +260,10 @@ async Task InitializeMetricsClient(CancellationToken cancellation { Audience = metricsClientAudience, Transport = new HttpClientTransport( - new HttpClient(new SocketsHttpHandler { PooledConnectionIdleTimeout = TimeSpan.FromMinutes(2) })) + new HttpClient(new SocketsHttpHandler + { + PooledConnectionIdleTimeout = TimeSpan.FromMinutes(2) + })) }); }