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

  1. Open the Azure Portal.
  2. Navigate to your Function App → Functions.
  3. Select your function and click Get Function URL.
  4. 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

  1. Open Power Automate and create a new Flow (instant, scheduled, or triggered).
  2. 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 (POST or GET).
    Most Azure Functions use POST when 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:

  1. Add a Parse JSON action in Power Automate.
  2. Use the sample response to generate a schema.
  3. Access success and message fields in later steps (e.g., conditionals, Teams messages, or SharePoint updates).

7. Security Considerations

  • Function Key: By default, Azure Functions require a code parameter (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

  1. Trigger: When a new item is created in SharePoint.
  2. Action: HTTP → POST to Azure Function with item data in Body.
  3. Action: Parse JSON of response.
  4. 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

StepAction
1Publish Azure Function
2Copy Function URL with key
3Create Flow in Power Automate
4Add HTTP action
5Configure Method, URI, Headers, Body
6Use Parse JSON for response
7Secure with AAD/API Management if needed

✅ With this setup, Power Automate can now trigger your Azure Function and use its output in any workflow.

Edvaldo Guimrães Filho Avatar

Published by