Skip to content

[Identity] Log user-assigned managed identity IDs#39621

Merged
pvaneck merged 1 commit intoAzure:mainfrom
pvaneck:identity-log-user-id
Mar 7, 2025
Merged

[Identity] Log user-assigned managed identity IDs#39621
pvaneck merged 1 commit intoAzure:mainfrom
pvaneck:identity-log-user-id

Conversation

@pvaneck
Copy link
Copy Markdown
Member

@pvaneck pvaneck commented Feb 7, 2025

Closes: #39081

@azure-sdk
Copy link
Copy Markdown
Collaborator

API change check

API changes are not detected in this pull request.

@pvaneck pvaneck force-pushed the identity-log-user-id branch from ad4d7df to 52179d0 Compare February 7, 2025 22:25
@pvaneck pvaneck marked this pull request as ready for review February 7, 2025 22:41
@pvaneck pvaneck requested review from a team and xiangyan99 as code owners February 7, 2025 22:41
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
@pvaneck pvaneck force-pushed the identity-log-user-id branch from 52179d0 to 51eeb71 Compare February 22, 2025 03:09
@xiangyan99 xiangyan99 requested a review from Copilot March 7, 2025 22:35
Copy link
Copy Markdown
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.

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.

@github-project-automation github-project-automation Bot moved this from Untriaged to In Progress in Azure Identity SDK Improvements Mar 7, 2025
@pvaneck pvaneck merged commit 57bc5f5 into Azure:main Mar 7, 2025
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Azure Identity SDK Improvements Mar 7, 2025
@pvaneck pvaneck deleted the identity-log-user-id branch March 7, 2025 22:48
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

[FEATURE REQ] Azure.Identity/DAC should log ClientId for user-assigned managed identities

4 participants