Skip to content

Conversation

@jasontaylordev
Copy link
Contributor

@jasontaylordev jasontaylordev commented Oct 20, 2025

This change migrates from the deprecated Azure.Monitor.Query package to the new Azure.Monitor.Query.Metrics package as outlined within #5148.

@jasontaylordev jasontaylordev changed the title Update AspNetCore dependencies to 8.0.21 Migrate from Azure.Monitor.Query (deprecated) to Azure.Monitor.Query.Metrics Oct 22, 2025
@johnsimons
Copy link
Member

@jasontaylordev I just want to confirm that the guidance in https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/monitor/MigrationGuide_Query.md is incorrect?

Copy link
Member

@johnsimons johnsimons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes LGTM, but I am unsure about the move of the client initialisation to the GetQueueNames method?

Comment on lines 285 to 296
client = new MetricsClient(
metricsEndpoint,
credential!,
new MetricsClientOptions
{
Audience = metricsQueryAudience,
Transport = new HttpClientTransport(
new HttpClient(new SocketsHttpHandler
{
PooledConnectionIdleTimeout = TimeSpan.FromMinutes(2)
}))
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the motivation to move the initialisation of the client to this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The metricsEndpoint needs to specify the region which can only be done once we have the ASB resource. Currently, that information is not available in InitializeCore. As per discussion, we are considering alternative options.

@jasontaylordev
Copy link
Contributor Author

@jasontaylordev I just want to confirm that the guidance in https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/monitor/MigrationGuide_Query.md is incorrect?

Yes, it is incorrect. The MetricsQueryClient guide links to the MetricsClient guide. Reviewing the repo it looks like a MetricsQueryClient guide does not exist! 😒

@jasontaylordev jasontaylordev marked this pull request as ready for review October 23, 2025 00:18
Updated the `BuildMetricsEndpoint` method to ensure the region is consistently formatted in lowercase when constructing the URI. Removed the unused `BuildMetricsEndpointFromAudience` method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants