Share via


MetricsQueryClient Constructors

Definition

Overloads

MetricsQueryClient()

Creates an instance of MetricsQueryClient to support mocking.

MetricsQueryClient(TokenCredential)

Creates an instance of MetricsQueryClient for Azure Public Cloud usage. Uses the default 'https://management.azure.com' endpoint. To access an Azure sovereign cloud, use the following constructor overload: MetricsQueryClient(TokenCredential, MetricsQueryClientOptions)

var client = new MetricsQueryClient(new DefaultAzureCredential());
MetricsQueryClient(TokenCredential, MetricsQueryClientOptions)

Creates an instance of MetricsQueryClient for Azure Public Cloud usage. Uses the default 'https://management.azure.com' endpoint, unless Audience is set to an Azure sovereign cloud.

MetricsQueryClient(Uri, TokenCredential, MetricsQueryClientOptions)

Creates an instance of MetricsQueryClient for the Azure cloud represented by endpoint.

MetricsQueryClient()

Source:
MetricsQueryClient.cs
Source:
MetricsQueryClient.cs

Creates an instance of MetricsQueryClient to support mocking.

protected MetricsQueryClient ();
Protected Sub New ()

Applies to

MetricsQueryClient(TokenCredential)

Source:
MetricsQueryClient.cs
Source:
MetricsQueryClient.cs

Creates an instance of MetricsQueryClient for Azure Public Cloud usage. Uses the default 'https://management.azure.com' endpoint. To access an Azure sovereign cloud, use the following constructor overload: MetricsQueryClient(TokenCredential, MetricsQueryClientOptions)

var client = new MetricsQueryClient(new DefaultAzureCredential());
public MetricsQueryClient (Azure.Core.TokenCredential credential);
new Azure.Monitor.Query.MetricsQueryClient : Azure.Core.TokenCredential -> Azure.Monitor.Query.MetricsQueryClient
Public Sub New (credential As TokenCredential)

Parameters

credential
TokenCredential

The TokenCredential instance to use for authentication.

Applies to

MetricsQueryClient(TokenCredential, MetricsQueryClientOptions)

Source:
MetricsQueryClient.cs
Source:
MetricsQueryClient.cs

Creates an instance of MetricsQueryClient for Azure Public Cloud usage. Uses the default 'https://management.azure.com' endpoint, unless Audience is set to an Azure sovereign cloud.

public MetricsQueryClient (Azure.Core.TokenCredential credential, Azure.Monitor.Query.MetricsQueryClientOptions options);
new Azure.Monitor.Query.MetricsQueryClient : Azure.Core.TokenCredential * Azure.Monitor.Query.MetricsQueryClientOptions -> Azure.Monitor.Query.MetricsQueryClient
Public Sub New (credential As TokenCredential, options As MetricsQueryClientOptions)

Parameters

credential
TokenCredential

The TokenCredential instance to use for authentication.

options
MetricsQueryClientOptions

The MetricsQueryClientOptions instance to use as client configuration.

Applies to

MetricsQueryClient(Uri, TokenCredential, MetricsQueryClientOptions)

Source:
MetricsQueryClient.cs
Source:
MetricsQueryClient.cs

Creates an instance of MetricsQueryClient for the Azure cloud represented by endpoint.

public MetricsQueryClient (Uri endpoint, Azure.Core.TokenCredential credential, Azure.Monitor.Query.MetricsQueryClientOptions options = default);
new Azure.Monitor.Query.MetricsQueryClient : Uri * Azure.Core.TokenCredential * Azure.Monitor.Query.MetricsQueryClientOptions -> Azure.Monitor.Query.MetricsQueryClient
Public Sub New (endpoint As Uri, credential As TokenCredential, Optional options As MetricsQueryClientOptions = Nothing)

Parameters

endpoint
Uri

The Azure Resource Manager service endpoint to use. Some examples include:

  • https://management.usgovcloudapi.net for Azure US Government Cloud
  • https://management.chinacloudapi.cn for Azure China Cloud

credential
TokenCredential

The TokenCredential instance to use for authentication.

options
MetricsQueryClientOptions

The MetricsQueryClientOptions instance to use as client configuration.

Applies to