-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Identity] Add cache hit debug logging #44963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Paul Van Eck <[email protected]>
7fa9b02 to
aa0723c
Compare
There was a problem hiding this 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 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Signed-off-by: Paul Van Eck <[email protected]>
xiangyan99
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to update changelog?
Signed-off-by: Paul Van Eck <[email protected]>
Added some additional debug logging to provide insight into access token cache hits.