[Identity] Log user-assigned managed identity IDs#39621
Merged
pvaneck merged 1 commit intoAzure:mainfrom Mar 7, 2025
Merged
Conversation
c07bf50 to
ad4d7df
Compare
Collaborator
|
API change check API changes are not detected in this pull request. |
ad4d7df to
52179d0
Compare
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
52179d0 to
51eeb71
Compare
Contributor
There was a problem hiding this comment.
PR Overview
This PR enhances the logging capabilities of the ManagedIdentityCredential by refactoring the validate_identity_config function to return user identity information and consolidating the logging logic. Key changes include:
- Refactoring validate_identity_config to return a tuple with key-value identity info and updating its usage in the credential’s init.
- Unifying the logging message construction to include the user-assigned identity details where applicable.
- Updating both synchronous and asynchronous credential implementations and their corresponding tests to verify the new logging behavior.
Reviewed Changes
| File | Description |
|---|---|
| sdk/identity/azure-identity/azure/identity/_credentials/managed_identity.py | Refactored validate_identity_config and unified logging message for credential type and user identity info. |
| sdk/identity/azure-identity/tests/test_managed_identity.py | Added tests to verify validate_identity_config output and logging messages. |
| sdk/identity/azure-identity/tests/test_managed_identity_async.py | Added tests to verify async logging messages. |
| sdk/identity/azure-identity/azure/identity/aio/_credentials/managed_identity.py | Similar refactoring and logging improvements as in the synchronous implementation. |
| sdk/identity/azure-identity/CHANGELOG.md | Updated to document the new logging behavior for ManagedIdentityCredential. |
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
xiangyan99
approved these changes
Mar 7, 2025
allenkim0129
pushed a commit
to allenkim0129/azure-sdk-for-python
that referenced
this pull request
Mar 11, 2025
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #39081