Skip to content

[Management] Configuration

Rujun Chen edited this page Aug 20, 2021 · 1 revision

Configure AzureResourceManager

Other than calling AzureResourceManager.authenticate() directly, you can also call AzureResourceManager.configure() to configure the client before calling .authenticate().

Note that instances of AzureResourceManager and AzureResourceManager.Authenticated are immutable. No configurations can be applied after .authenticate() is called.

Configuration on HTTP Client

With the Azure Management Libraries for Java, you can choose an HttpClient implementation, or even provide a custom one.

By default, management libraries use the HTTP client loaded in runtime. Specifically, you can configure and use Netty HTTP client.

HttpClient httpClient = new NettyAsyncHttpClientBuilder()
    .readTimeout(Duration.ofMinutes(2))
    .build();

AzureResourceManager azureResourceManager = AzureResourceManager
    .configure()
    .withHttpClient(httpClient)
    ...

Configuration on HTTP Pipeline

The available configurations are:

  • withHttpClient() set the HTTP client
  • withLogOptions() set the option of HTTP logging, including log level, allowed query parameter names, and header names
  • withRetryPolicy() set the retry policy
  • withAuxiliaryCredential() and withAuxiliaryCredentials() set the cross-tenant auxiliary credentials
  • withPolicy() add the additional policy to the HTTP pipeline
Clone this wiki locally