How can I get Azure Synapse Pipeline run ID using python SDK in a synapse notebook? I have a ML pipeline that do a batch prediction everyday. What I want to do is get the pipeline run ID to save inside a DataFrame that is created in one of the notebook that I run in synapse.
I'm running my pipeline using the following major activities:
I saw that you can put a system variable in the file name with the pipeline run id. But I want to now if there is a way to get the current pipeline run id and my notebook is being executed using the azure python sdk
You can do it using the Toggle parameter cell option in Synapse notebook cell.
Use Toggle parameter cell option in synapse notebook cell and give any parameter name and assign any value to it. (Here I have given empty string).
In Notebook activity of pipeline, use Base parameters and give same name and same data type for it. In dynamic content of the parameter give @pipeline().RunId
like below.
Execute this activity and Go to Monitor-> Pipeline runs -> your pipeline-> Notebook activity snapshot and you can see the output of the Notebook.
You can use this parameter in the Notebook as per your requirement.