I have a scheduled AzureML pipeline. Every run of the pipeline gets an autogenerated name in the AzureML UI. I’d like to pass this name to the pipeline. How could I do that?
The scheduled pipeline is created as follows:
step = CommandStep(command="myscript.sh --job-name=<AZUREML JOB NAME>")
pipeline = Pipeline(workspace, [step])
published_pipeline = pipeline.publish(name='my pipeline')
schedule = Schedule.create(workspace=workspace, pipeline_id=published_pipeline.id, ...)
I would like to pass the run name create by AzureML e.g. as a command line parameter as in the example above.
2
Answers
From within an AzureML pipeline (SDK v2), you can read the run_id from an environment variable and then get the display name as follows
The pipeline is referenced with run id/job name.
If you are using sdk v2, use below code.
Here, you use the pipeline job object after submitting the job to get the job name.
Output:
OR
In sdk v1
Next, pass this id to your step job.