Recently we had a chance to work on developing a custom connector in Microsoft Power Automate. We had to consume Microsoft Azure Machine Learning Services model using REST API and perform prediction. For this purpose, we used KAISPE Student Churn Prediction model and the business scenario we completed was to predict student churn when a set of input data is uploaded on Microsoft OneDrive folder in CSV form.
We started with a blank connector (Create from blank). After providing the REST API URL, we used “API Key” as the authentication mechanism with “Authorization” as the only header parameter.
Next in the connector Definition, we added an action. By definition, “Actions determine the operations that users can perform. Actions can be used to read, create, update or delete resources in the underlying connector.” Then we provided the Request operation “POST” along with URL and body as shown below:
The default response was also provided. In our case, the Response JSON looks like this. If you are using Postman, it would be a lot easier for you to get these JSONs and test your API connection.
“Scored Labels”: “string”,
“Scored Probabilities”: 0.0
In the last step, we tested the custom connector functionality by providing the REST API key of our Azure machine learning model. An important point to note here is since our API was expecting the following in header:
Authorization: Bearer <API Key>
So we had to use Bearer UEEF(#(#NDNDJD in the Connection value. Then we provided the sample input in JSON to test the connector operation to receive the response successfully as shown below:
We are now ready to use this connector in any flow. An example is shown below:
We hope you have found it useful. For any queries, please contact firstname.lastname@example.org