I have a published Azure ML Pipeline that I am trying to trigger from an Automate Flow I have that triggers when users edit a document. Since I have the REST Endpoint for the Published Pipeline, I figured I should be able to make a POST request using the HTTP module available in Power Automate to trigger the pipeline.
However, when I actually try this, I get an authentication error. I assume this is because I need to include some access token with the REST Endpoint, but I can't find any documentation that will tell me where to get that token from. Please note that I do not need to pass any data to the Pipeline, it handles its own data collection, I literally just need a way to trigger it.
Does anybody know how to trigger a Published Azure ML Pipeline using the REST Endpoint? Does it make sense to use the HTTP module, or is there a better way to achieve this?
So I figured out how to do it by following the directions contained within this piece of Microsoft Documentation: https://learn.microsoft.com/en-us/azure/machine-learning/how-to-manage-rest
Specifically, it required performing two of the calls in the documentation;
curl -X POST https://login.microsoftonline.com//oauth2/token -d "grant_type=client_credentials&resource=https%3A%2F%2Fmanagement.azure.com%2F&client_id=&client_secret="
curl -X POST {PIPELINE_REST_ENDPOINT} -H "Authorisation:Bearer {AAD_TOKEN}" -H "Content-Type: application/json" -d "{"ExperimentName": "{EXPERIMENT_NAME}","ParameterAssignments": {}}"