Skip to content

Commit 3e79c55

Browse files
committed
[Identity] Adjust IMDS retry backoff
This better aligns with other languages. Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
1 parent 28ea606 commit 3e79c55

4 files changed

Lines changed: 18 additions & 4 deletions

File tree

sdk/identity/azure-identity/BREAKING_CHANGES.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Breaking Changes
22

3+
## 1.16.0
4+
5+
### Behavioral change to `ManagedIdentityCredential` in IMDS managed identity scenarios
6+
7+
As of `azure-identity` 1.16.0, `ManagedIdentityCredential` makes a minor change to the retry behavior in environments where Instance Metadata Service (IMDS) managed identity is used. The retry backoff factor for IMDS requests was reduced to `0.8` from `2` to prevent excessive delays during retries and to improve responsiveness. This change might affect workloads that rely on the previous retry behavior.
8+
9+
If retry settings need to be customized for IMDS managed identity scenarios, users can pass in `RetryPolicy` parameters noted in the [Azure Core Client library developer reference](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies) to the `ManagedIdentityCredential` constructor. For example:
10+
11+
```python
12+
credential = ManagedIdentityCredential(retry_connect=8, retry_backoff_factor=2)
13+
```
14+
315
## 1.11.0
416

517
### Behavioral change to credential types supporting multi-tenant authentication

sdk/identity/azure-identity/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Release History
22

3-
## 1.16.0b3 (Unreleased)
3+
## 1.16.0 (Unreleased)
44

55
### Features Added
66

77
### Breaking Changes
88

9+
- For IMDS requests in `ManagedIdentityCredential`, the retry backoff factor was reduced from 2 to 0.8 in order to avoid excessive retry delays. This change might potentially affect workloads that rely on the previous retry behavior. See [BREAKING_CHANGES.md](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/identity/azure-identity/BREAKING_CHANGES.md).
10+
911
### Bugs Fixed
1012

1113
### Other Changes

sdk/identity/azure-identity/azure/identity/_credentials/imds.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
PIPELINE_SETTINGS = {
2323
"connection_timeout": 2,
24-
"retry_backoff_factor": 2,
25-
"retry_backoff_max": 60,
24+
# Five retries, with each retry sleeping for [0.0s, 1.6s, 3.2s, 6.4s, 12.8s] between attempts.
25+
"retry_backoff_factor": 0.8,
2626
"retry_on_status_codes": [404, 410, 429] + list(range(500, 600)),
2727
"retry_status": 5,
2828
"retry_total": 5,

sdk/identity/azure-identity/azure/identity/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Copyright (c) Microsoft Corporation.
33
# Licensed under the MIT License.
44
# ------------------------------------
5-
VERSION = "1.16.0b3"
5+
VERSION = "1.16.0"

0 commit comments

Comments
 (0)