Registering Data Asset from Job with v2 SDK/CLI

Tomas Van Pottelbergh 21 Reputation points
2022-09-16T11:40:15.87+00:00

Following this example I tried to register the output of a job as a Data Asset, by using the azureml:<my_data>:<version> syntax for the path. The following minimal example shows what I'm trying to achieve:

from azure.ai.ml import command  
from azure.ai.ml.entities import Data  
from azure.ai.ml import Input, Output  
from azure.ai.ml.constants import AssetTypes  
  
my_job_outputs = {  
    "prep_data": Output(type=AssetTypes.URI_FOLDER, path="azureml:test_output:1")  
}  
  
job = command(  
    command="echo 'test' > ${{outputs.prep_data}}",  
    outputs=my_job_outputs,  
    environment="test-env@latest",  
    compute="cpu-cluster",  
)  
  
# submit the command  
returned_job = ml_client.create_or_update(job)  

Unfortunately, this fails. The job submission works, but the Job is immediately going to the Failed status with the following error message:

Invalid output uri azureml:test_output:1/ found for output prep_data of run , the list of supported uri formats are ["wasb://", "wasbs://", "adl://", "abfs", "abfss://", "azureml://"]  

What is the correct syntax for registering a Data Asset from a Job output?

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,244 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.