Open
Conversation
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
7fa9b02 to
aa0723c
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds debug logging around access token cache hits in the Azure Identity internal clients to give better observability into when tokens are served from cache. It also performs minor signature formatting cleanups (trailing commas) for consistency.
Changes:
- Introduced module-level loggers in
managed_identity_client.pyandaad_client_base.pyand added detailed debug messages when valid cached access tokens are found (including scopes/resource, tenant, TTL, refresh timing, and cache identity). - Normalized some function signatures by adding trailing commas to
**kwargsparameters for consistency and formatting.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sdk/identity/azure-identity/azure/identity/_internal/managed_identity_client.py | Adds a module-level logger and emits a detailed debug log whenever a managed identity access token is returned from cache, including expiry, refresh timing, and cache identity. |
| sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py | Adds a module-level logger and emits a detailed debug log on AAD cached token hits (with scopes, tenant, expiry, refresh timing, and cache identity), and updates several method signatures with trailing commas. |
sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
xiangyan99
approved these changes
Feb 6, 2026
Member
xiangyan99
left a comment
There was a problem hiding this comment.
Do you want to update changelog?
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.
Added some additional debug logging to provide insight into access token cache hits.