Azure Functions allow you to host serverless code in the cloud. Power Automate provides workflows to automate business processes. Connecting both is powerful: you can trigger complex backend logic directly from a Flow.
🔗 Calling an Azure Function from Power Automate with the HTTP Connector
1. Introduction
Azure Functions allow you to host serverless code in the cloud. Power Automate provides workflows to automate business processes. Connecting both is powerful: you can trigger complex backend logic directly from a Flow.
This article explains how to configure the HTTP action in Power Automate to call an Azure Function, pass input parameters, and consume the response.
2. Prerequisites
- An active Azure subscription.
- A published Azure Function (HTTP Trigger).
- Access to Power Automate (Flow).
- Function URL with Function Key or configured with Azure AD Authentication.
3. Get the Function URL
- Open the Azure Portal.
- Navigate to your Function App → Functions.
- Select your function and click Get Function URL.
- Copy the URL (example):
https://myfunctionapp.azurewebsites.net/api/ProcessData?code=ABCD1234xyz==
This URL is what you’ll use in Power Automate.
4. Create the Flow in Power Automate
- Open Power Automate and create a new Flow (instant, scheduled, or triggered).
- Add the HTTP action (Premium connector).
You will see the configuration screen like the image above.
5. Configure the HTTP Action
- Method:
Choose the method required by your Function (POSTorGET).
Most Azure Functions usePOSTwhen processing data. - URI:
Paste the Function URL obtained earlier. Example:https://myfunctionapp.azurewebsites.net/api/ProcessData?code=ABCD1234xyz== - Headers:
If your Function expects JSON:Key: Content-Type Value: application/json - Body:
Enter the JSON payload required by your Function. Example:{ "projectId": "123", "status": "InProgress" }
6. Handling the Response
If the Function returns JSON (for example):
{
"success": true,
"message": "Item created in SharePoint"
}
You can:
- Add a Parse JSON action in Power Automate.
- Use the sample response to generate a schema.
- Access
successandmessagefields in later steps (e.g., conditionals, Teams messages, or SharePoint updates).
7. Security Considerations
- Function Key: By default, Azure Functions require a
codeparameter (shared secret). - Azure AD Authentication: For enterprise use, configure the Function with AAD so that Power Automate authenticates via OAuth instead of a simple key.
- API Management: For additional control, expose the Function via Azure API Management and call it securely from Power Automate.
8. Example End-to-End Flow
- Trigger: When a new item is created in SharePoint.
- Action: HTTP → POST to Azure Function with item data in Body.
- Action: Parse JSON of response.
- Condition: If
success = true, update the item with confirmation.
9. Troubleshooting
- 401 Unauthorized → Check the Function Key or authentication setup.
- 404 Not Found → Verify the Function URL.
- Timeouts → Azure Functions default timeout is 5 minutes (consumption plan); increase if needed in Premium/Elastic plans.
- Invalid JSON → Validate the request body format with a JSON validator.
10. Summary Table
| Step | Action |
|---|---|
| 1 | Publish Azure Function |
| 2 | Copy Function URL with key |
| 3 | Create Flow in Power Automate |
| 4 | Add HTTP action |
| 5 | Configure Method, URI, Headers, Body |
| 6 | Use Parse JSON for response |
| 7 | Secure with AAD/API Management if needed |
✅ With this setup, Power Automate can now trigger your Azure Function and use its output in any workflow.
