How do I access an input parameter in Azure Machine Learning endpoints?

Josh Griffith 31 Reputation points
2020-10-12T06:55:23.003+00:00

I've created an Azure ML Endpoint Pipeline with a single 'Execute Python Script'. From the script, I am looking for a way to access the input 'ParameterAssignments' that I POST to the endpoint to trigger the pipeline. I expected to see them somewhere in Run.get_context(), but I haven't had any luck. I simply need a way to POST arbitrary values that my Python scripts can access. Thank you!

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,421 questions
{count} vote

Accepted answer
  1. Lu Zhang (AI) 106 Reputation points Microsoft Employee
    2020-10-19T01:08:06.24+00:00

    I just confirmed with our engineer that you cannot set up a pipeline parameter and use it without tying it with any of the module parameter. So the workaround is - make the pipeline parameter as one of the inputs (i.e. dataset) to "Execute Python Script" module and set it as pipeline parameter. Then you can change it every time when calling the pipeline.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. hunga 1 Reputation point
    2021-05-27T06:21:17.273+00:00

    Hi @Lu Zhang (AI) , I am finding a way to connect to Postgres in my pipeline. I don't think 'Import Data' supports it, so I am thinking to write my own 'Execute Python Script' to load the data from Postgres. As I don't use 'Import Data', is there another way to access the pipeline parameters inside 'Execute Python Script'?

    0 comments No comments