azure.ai.ml.identity package

Contains Identity Configuration for Azure Machine Learning SDKv2.

exception azure.ai.ml.identity.CredentialUnavailableError(message: object | None = None, response: _HttpResponseCommonAPI | None = None, **kwargs: Any)[source]

The credential did not attempt to authenticate because required data or state is unavailable.

add_note()

Exception.add_note(note) – add a note to the exception

raise_with_traceback() None

Raise the exception with the existing traceback.

Deprecated since version 1.22.0: This method is deprecated as we don’t support Python 2 anymore. Use raise/from instead.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
class azure.ai.ml.identity.AzureMLOnBehalfOfCredential(**kwargs: Any)[source]

Authenticates a user via the on-behalf-of flow.

This credential can only be used on Azure Machine Learning Compute or Azure Machine Learning Serverless Spark Compute during job execution when user request to run job using its identity.

close() None[source]

Close the credential’s transport session.

get_token(*scopes: str, **kwargs: Any) AccessToken[source]

Request an access token for scopes.

This method is called automatically by Azure SDK clients.

Parameters:

scopes (str) – desired scope for the access token. This credential allows only one scope per request.

Return type:

AccessToken

Returns:

AzureML On behalf of credentials isn’t available in the hosting environment

Raises:

~azure.ai.ml.identity.CredentialUnavailableError