MsiAuthentication Class
Manages authentication using a managed identity in Azure Active Directory.
When using Azure ML SDK on Azure Virtual Machine (VM), you can authenticate with a managed identity (formerly known as Managed Service Identity - MSI). Using a managed identity allows the VM connect to your workspace without storing credentials in Python code, thus decoupling the authentication process from any specific user login.
Class MsiAuthentication constructor.
- Inheritance
-
MsiAuthentication
Constructor
MsiAuthentication(cloud=None, **kwargs)
Parameters
Name | Description |
---|---|
cloud
|
The name of the target cloud. Can be one of "AzureCloud", "AzureChinaCloud", or "AzureUSGovernment". If no cloud is specified, any configured default from the Azure CLI is used. If no default is found, "AzureCloud" is used. Default value: None
|
identity_config
Required
|
a mapping |
cloud
Required
|
The name of the target cloud. Can be one of "AzureCloud", "AzureChinaCloud", or "AzureUSGovernment". If no cloud is specified, any configured default from the Azure CLI is used. If no default is found, "AzureCloud" is used. |
identity_config
Required
|
a mapping |
Remarks
The following example shows how to use MsiAuthentication.
from azureml.core.authentication import MsiAuthentication
msi_auth = MsiAuthentication()
ws = Workspace(subscription_id="my-subscription-id",
resource_group="my-ml-rg",
workspace_name="my-ml-workspace",
auth=msi_auth)
print("Found workspace {} at location {}".format(ws.name, ws.location))
Full sample is available from https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/manage-azureml-service/authentication-in-azureml/authentication-in-azureml.ipynb