In this example, you submit an Azure Machine Learning job that writes data to your default Azure Machine Learning Datastore. Write data from your Azure Machine Learning job to Azure Storage Next, submit your job using the CLI: az ml job create -f. # This command job prints the first 10 lines of the fileĮnvironment: azureml://registries/azureml/environments/sklearn-1.1/versions/4 # You don't need to set an identity to if you use a credential-based datastore # mode: download # Download the data to the compute target # mode: ro_mount # Read-only mount on the compute target # This command job uses the head Linux command to print the first 10 lines of the fileĮnvironment="azureml://registries/azureml/environments/sklearn-1.1/versions/4",Ĭreate a job specification YAML file (. "input_data": Input(type=data_type, path=path, mode=mode) # You also set identity to None if you use a credential-based datastore # This example accesses public data, so we don't need an identity. # identity = ManagedIdentit圜onfiguration() # Use the compute target managed identity # identity = UserIdentit圜onfiguration() # Use the user's identity # You can set the identity you want to use in a job to access the data. # mode = InputOutputModes.DOWNLOAD # Download the data to the compute target # mode = InputOutputModes.RO_MOUNT # Read-only mount on the compute target # The path we set above is a specific file # data_type = AssetTypes.MLTABLE # an mltable # data_type = AssetTypes.URI_FOLDER # a folder # data_type = AssetTypes.URI_FILE # a specific file # What type of data does the path point to? Options include: # We set the path to a file on a public blob container # Blob: ADLS: Datastore: azureml://datastores//paths/ # Set your subscription, resource group and workspace name:ĭefaultAzureCredential(), subscription_id, resource_group, workspace Use None when using credential-based (key/SAS token) datastores or when accessing public data.įrom azure.ai.ml import command, Input, MLClient, UserIdentit圜onfiguration, ManagedIdentit圜onfigurationįrom azure.ai.ml.constants import AssetTypes, InputOutputModesįrom azure.identity import DefaultAzureCredential None: Don't specify an identity to access the data.Managed identity: Use the managed identity of the compute target to access data.User identity: Passthrough your Azure Active Directory identity to access the data.Azure Machine Learning seamlessly handles authentication to cloud storage using Azure Active Directory passthrough. However, you can adapt the snippet to access your own data in a private Azure Storage account, by updating the path (for details on how to specify paths, read Paths). In this example, you submit an Azure Machine Learning job that accesses data from a public blob storage account. Read data from Azure storage in an Azure Machine Learning job The Azure Machine Learning SDK for Python v2.īefore you explore the detailed options available to you when accessing data, we show you the relevant code snippets to access data so you can get started quickly. Try the free or paid version of Azure Machine Learning. If you don't have an Azure subscription, create a free account before you begin.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |