How do I get the experimentID inside a running pipeline script?

Fabio Beka 1 Reputation point
2021-11-30T17:19:01.14+00:00

Hello, I'm writing a ML pipeline.

At the end of a script I have to write the output to a SQL database, and I would need the ExperimentID as a field of the output dataframe.

Is there a way for me to find within the running script in which experiment it's being run?
Or is there a way for me to input the ExperimentID as a parameter to the pipeline at launch? From what I understand parameters are defined before the experiment is created so that's a bit confusing.

In case this is too complicated, is there a way I can somehow chain the pipeline output inside a script to the experiment it's being run?

Thank you very much,

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,560 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. GiftA-MSFT 11,151 Reputation points
    2021-12-01T04:39:29.95+00:00

    Hi, you can use the get_context method of the Run Class to get the run id. Here's an example:

    run = Run.get_context()  
    run_id = run.id  
    
    0 comments No comments