Integrating Azure Functions with Power Automate allows you to run serverless code in the cloud directly from automated workflows.
🔗 Calling an Azure Function from Power Automate with the HTTP Connector
1. Introduction
Integrating Azure Functions with Power Automate allows you to run serverless code in the cloud directly from automated workflows.
This article explains how to:
- Publish and get the URL of an Azure Function.
- Configure Power Automate’s HTTP connector to call the function.
- Send parameters in JSON format.
- Parse and use the response in subsequent steps.
2. Prerequisites
- An Azure subscription with a Function App already deployed.
- Access to Power Automate (Flows).
- Basic knowledge of JSON format.
3. Get the Function URL
- Open the Azure Portal.
- Go to your Function App → Functions.
- Select your Function.
- Click Get Function URL.
Example:https://myfunctionapp.azurewebsites.net/api/ProcessData?code=ABCD1234xyz==🔑 Thecode=...is the Function Key used for authentication.
4. Create a Flow in Power Automate
- Open Power Automate.
- Create a new Flow (instant, scheduled, or automated).
- Add an HTTP action (Premium connector).
You’ll see the following fields (like in the screenshot):
- Method
- URI
- Headers
- Body
5. Configure the HTTP Action
Here’s how to configure each field:
- Method:
ChoosePOST(orGET, depending on your Function). - URI:
Paste the Function URL (with?code=...). Example:https://myfunctionapp.azurewebsites.net/api/ProcessData?code=ABCD1234xyz== - Headers:
Content-Type : application/json - Body:
Example JSON payload:{ "projectId": "123", "status": "InProgress" }
6. Example Azure Function Response
Suppose the Function returns JSON like this:
{
"success": true,
"message": "Project 123 created in SharePoint",
"timestamp": "2025-09-26T18:30:00Z"
}
7. Parse JSON in Power Automate
To use the response, add a Parse JSON action:
- Content:
Bodyof the HTTP action. - Schema (paste this):
{ "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" } } }
8. Use the Parsed Values
After parsing, you can access these values in Power Automate:
success→trueorfalsemessage→"Project 123 created in SharePoint"timestamp→"2025-09-26T18:30:00Z"
Example: Add a Condition action:
- If
success = true, send a Teams notification or update SharePoint. - If
success = false, log an error or send an alert.
9. End-to-End Flow Example
- Trigger: When a SharePoint item is created.
- Action: HTTP POST → Azure Function.
- Action: Parse JSON.
- Action: Condition (check
success).- Yes → update SharePoint with
message. - No → send error notification.
- Yes → update SharePoint with
10. Security Options
- Function Key (default): Shared secret in the URL (
code=...). - Azure AD Authentication: Use OAuth2 for enterprise scenarios.
- API Management: Expose the Function securely as an API.
11. Troubleshooting
- 401 Unauthorized → Invalid or missing key.
- 404 Not Found → Wrong URL.
- Timeout → Azure Functions (Consumption plan) have 5 min default timeout. Premium plans allow longer.
- Invalid JSON → Check payload format.
12. Quick Reference Table
| Step | Action |
|---|---|
| 1 | Publish Function & copy URL |
| 2 | Create Flow in Power Automate |
| 3 | Add HTTP action |
| 4 | Configure Method, URI, Headers, Body |
| 5 | Parse JSON response |
| 6 | Use values in conditions or updates |
| 7 | Secure with AAD or API Management (optional) |
✅ Conclusion
With these steps, you can integrate any Azure Function into a Power Automate workflow, sending data (via JSON) and using the Function’s response to make decisions or trigger further actions.
