NOTE: Samples in this file apply only to packages that follow Azure SDK Design Guidelines. Names of such packages usually start with Azure
.
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
}
};
using HttpClient client = new HttpClient();
SecretClientOptions options = new SecretClientOptions
{
Transport = new HttpClientTransport(client)
};
using HttpClient client = new HttpClient(
new HttpClientHandler()
{
Proxy = new WebProxy(new Uri("http://example.com"))
});
SecretClientOptions options = new SecretClientOptions
{
Transport = new HttpClientTransport(client)
};
By default only URI and headers are logged to enable content logging set the Diagnostics.IsLoggingContentEnabled
client option:
SecretClientOptions options = new SecretClientOptions()
{
Diagnostics =
{
IsLoggingContentEnabled = true
}
};
Some sensetive headers and query parameters are not logged by default and are displayed as REDACTED
, to include them in logs use the Diagnostics.LoggedHeaderNames
and Diagnostics.LoggedQueryParameters
client options.
SecretClientOptions options = new SecretClientOptions()
{
Diagnostics =
{
LoggedHeaderNames = { "x-ms-request-id" },
LoggedQueryParameters = { "api-version" }
}
};
You can also disable redaction completely by adding a "*"
to collections mentioned above.
SecretClientOptions options = new SecretClientOptions()
{
Diagnostics =
{
LoggedHeaderNames = { "*" },
LoggedQueryParameters = { "*" }
}
};