ManagedIdentityCredential Class
Authenticates with an Azure managed identity in any hosting environment which supports managed identities.
This credential defaults to using a system-assigned identity. To configure a user-assigned identity, use one of the keyword arguments. See Azure Active Directory documentation for more information about configuring managed identity for applications.
- Inheritance
-
azure.identity.aio._internal.AsyncContextManagerManagedIdentityCredential
Constructor
ManagedIdentityCredential(**kwargs: Any)
Parameters
- client_id
- str
a user-assigned identity's client ID or, when using Pod Identity, the client ID of an Azure AD app registration. This argument is supported in all hosting environments.
a mapping {parameter_name: value} specifying a user-assigned identity by its object
or resource ID, for example {"object_id": "..."}. Check the documentation for your hosting environment to
learn what values it expects.
Methods
| close |
Close the credential's transport session. |
| get_token |
Asynchronously request an access token for scopes. This method is called automatically by Azure SDK clients. |
close
Close the credential's transport session.
async close()
get_token
Asynchronously request an access token for scopes.
This method is called automatically by Azure SDK clients.
async get_token(*scopes: str, **kwargs: Any) -> AccessToken
Parameters
- scopes
- str
desired scope for the access token. This credential allows only one scope per request.
Return type
Exceptions
managed identity isn't available in the hosting environment
Feedback
Submit and view feedback for