Skip to content

Azure identity needs a "whoami" function. #41519

Open
@cbare

Description

@cbare

Greetings,

Is your feature request related to a problem? Please describe.
Debugging Azure permissions is often very confusing, especially in least-permissions scenarios where you don't have access to the environment. I want to be sure my code is running with the correct managed identity.

Describe the solution you'd like
A function along the lines of this:

credential = DefaultAzureCredential()
principal_details = azure.identity.whoami(credential)
logger.info('Authenticated as: %s %s', principal_details.name, principal_details.client_id)

This would help identify misconfiguration, especially in the unfortunate case where a different team manages the environment in which the code runs.

Metadata

Metadata

Assignees

Labels

Azure.IdentityClientThis issue points to a problem in the data-plane of the library.customer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-requestThis issue requires a new behavior in the product in order be resolved.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team

Type

No type

Projects

Status

Untriaged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions