Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.2 KB

Configuration.md

File metadata and controls

47 lines (36 loc) · 1.2 KB

Azure client configuration samples

NOTE: Samples in this file apply only to packages that follow Azure SDK Design Guidelines. Names of such packages usually start with Azure.

Configuring retry options

To modify the retry options use the Retry property of client options class.

Be default clients are setup to retry 3 times with exponential retry kind and initial delay of 0.8 sec.

SecretClientOptions options = new SecretClientOptions()
{
    Retry =
    {
        Delay = TimeSpan.FromSeconds(2),
        MaxRetries = 10,
        Mode = RetryMode.Fixed
    }
};

User provided HttpClient instance

using HttpClient client = new HttpClient();

SecretClientOptions options = new SecretClientOptions
{
    Transport = new HttpClientTransport(client)
};

Configuring a proxy

using HttpClient client = new HttpClient(
    new HttpClientHandler()
    {
        Proxy = new WebProxy(new Uri("http://example.com"))
    });

SecretClientOptions options = new SecretClientOptions
{
    Transport = new HttpClientTransport(client)
};