Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sdk/identity/azure-identity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### Bugs Fixed

- `ManagedIdentityCredential` will now correctly retry when the instance metadata endpoint returns a 410 response. ([#32200](https://github.com/Azure/azure-sdk-for-python/pull/32200))

### Other Changes

## 1.15.0b1 (2023-09-12)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"connection_timeout": 2,
"retry_backoff_factor": 2,
"retry_backoff_max": 60,
"retry_on_status_codes": [404, 429] + list(range(500, 600)),
"retry_on_status_codes": [404, 410, 429] + list(range(500, 600)),
"retry_status": 5,
"retry_total": 5,
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/identity/azure-identity/tests/test_imds_credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ def test_imds_request_failure_docker_desktop():
def test_retries():
mock_response = mock.Mock(
text=lambda encoding=None: b"{}",
headers={"content-type": "application/json", "Retry-After": "0"},
headers={"content-type": "application/json"},
content_type="application/json",
)
mock_send = mock.Mock(return_value=mock_response)

total_retries = PIPELINE_SETTINGS["retry_total"]

assert within_credential_chain.get() == False
for status_code in (404, 429, 500):
for status_code in (404, 410, 429, 500):
mock_send.reset_mock()
mock_response.status_code = status_code
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ async def test_cache():
async def test_retries():
mock_response = mock.Mock(
text=lambda encoding=None: b"{}",
headers={"content-type": "application/json", "Retry-After": "0"},
headers={"content-type": "application/json"},
content_type="application/json",
)
mock_send = mock.Mock(return_value=mock_response)

total_retries = PIPELINE_SETTINGS["retry_total"]

for status_code in (404, 429, 500):
for status_code in (404, 410, 429, 500):
mock_send.reset_mock()
mock_response.status_code = status_code
try:
Expand Down