Skip to content

Conversation

@christothes
Copy link
Member

fixes #47057

Copilot AI review requested due to automatic review settings June 5, 2025 21:21
@christothes christothes requested review from a team and JonathanCrd as code owners June 5, 2025 21:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures that when the IMDS endpoint times out, ManagedIdentityCredential surfaces a CredentialUnavailableException instead of propagating an MSAL error. Key changes include:

  • Added a non-parallelizable test (ThrowsCredentialUnavailableWhenIMDSTimesOut) to verify timeout mapping.
  • Wrapped the MSAL call in ManagedIdentityClient with a catch for timeouts and introduced HasInnerExceptionMatching.
  • Updated the changelog to document the fix.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
sdk/identity/Azure.Identity/tests/ManagedIdentityCredentialTests.cs Added a test to simulate an IMDS timeout and assert CredentialUnavailableException is thrown.
sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs Added try/catch around MSAL calls to translate timeout errors and introduced a helper method.
sdk/identity/Azure.Identity/CHANGELOG.md Documented the bug fix in the changelog.

…thub.com:christothes/azure-sdk-for-net into chriss/MiCred-throws-CUE-on-endpoint-unavailable
@christothes christothes merged commit 1dd72d9 into Azure:main Jun 6, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Possible breaking change in ChainedTokenCredential in Azure 1.13.0 and 1.13.1

2 participants