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

  1. Open the Azure Portal.
  2. Go to your Function App → Functions.
  3. Select your Function.
  4. Click Get Function URL.
    Example: https://myfunctionapp.azurewebsites.net/api/ProcessData?code=ABCD1234xyz== 🔑 The code=... is the Function Key used for authentication.

4. Create a Flow in Power Automate

  1. Open Power Automate.
  2. Create a new Flow (instant, scheduled, or automated).
  3. 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:
    Choose POST (or GET, 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: Body of 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:

  • successtrue or false
  • message"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

  1. Trigger: When a SharePoint item is created.
  2. Action: HTTP POST → Azure Function.
  3. Action: Parse JSON.
  4. Action: Condition (check success).
    • Yes → update SharePoint with message.
    • No → send error notification.

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

StepAction
1Publish Function & copy URL
2Create Flow in Power Automate
3Add HTTP action
4Configure Method, URI, Headers, Body
5Parse JSON response
6Use values in conditions or updates
7Secure 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.

Edvaldo Guimrães Filho Avatar

Published by