Skip to content

Commit 9c4c531

Browse files
Apply suggestions from code review
Co-authored-by: Christopher Scott <[email protected]>
1 parent e62801f commit 9c4c531

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/azure/sdk/authentication/authentication-best-practices.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ Other types of .NET apps can reuse credential instances as follows:
3535
The Azure Identity library for .NET allows you to authenticate via managed identity with `ManagedIdentityCredential`. The way you use `ManagedIdentityCredential` impacts the applied retry strategy:
3636

3737
- When used via `DefaultAzureCredential`:
38-
- No retries are attempted when token acquisition fails, which makes this the least resilient option.
38+
- No retries are attempted when the initial token acquisition attempt fails or times out after a short duration, which makes this the least resilient option.
3939
- When used via any other approach, such as `ChainedTokenCredential` or `ManagedIdentityCredential` directly:
40-
- The time interval between retries starts at 0.8 seconds, and a maximum of five retries are attempted.
40+
- The time interval between retries starts at 0.8 seconds and increases exponentially. A maximum of five retries are attempted.
4141
- If the Azure service to which you're authenticating provides a `Retry-After` response header, the next retry is delayed by the duration specified in that header's value.
4242
- If the service doesn't provide a `Retry-After` header, the maximum permissible delay between retries is 1 minute.
4343
- To change any of the default retry settings, use the `Retry` property on `ManagedIdentityCredentialOptions`. For example, retry a maximum of three times, with a starting interval of 0.5 seconds:

docs/azure/sdk/includes/default-azure-credential-usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
`DefaultAzureCredential` is the most approachable way to get started with the Azure Identity library, but that convenience also introduces certain tradeoffs. For example, the specific credential in the [chain](/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet) that will succeed and be used for request authentication can't be guaranteed ahead of time. In a production environment, this unpredictability can introduce significant and sometimes subtle problems.
2+
`DefaultAzureCredential` is the most approachable way to get started with the Azure Identity library, but that convenience also introduces certain tradeoffs. For example, the specific credential in the [chain](/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet) that will succeed and be used for request authentication is not 100% deterministic. In a production environment, this unpredictability can introduce significant and sometimes subtle problems.
33

44
For example, consider the following hypothetical sequence of events:
55

@@ -13,7 +13,7 @@ For example, consider the following hypothetical sequence of events:
1313
`DefaultAzureCredential` also introduces the following challenges in some scenarios:
1414

1515
- **Debugging challenges**: When authentication fails, it can be difficult to identify and [debug the offending credential](/dotnet/azure/sdk/authentication/credential-chains?tabs=dac#debug-a-chained-credential). Enable logging to see the sequential progression and success or failure status of each credential.
16-
- **Performance overhead**: Sequential credential attempts can introduce performance overhead. For example, managed identity is unavailable on a local development machine. Consequently, `ManagedIdentityCredential` always fails locally, unless explicitly disabled via its corresponding `Exclude`-prefixed property.
16+
- **Performance overhead**: Sequential credential attempts can introduce performance overhead into the developer inner loop. For example, managed identity is unavailable on a local development machine. Consequently, `ManagedIdentityCredential` always fails locally, unless explicitly disabled via its corresponding `Exclude`-prefixed property.
1717

1818
To prevent these types of subtle issues or silent failures in production apps, strongly consider moving from `DefaultAzureCredential` to one of the following deterministic solutions:
1919

0 commit comments

Comments
 (0)