fbpx

Power Apps: HTTP with Azure AD connector

Problem: By default, the HTTP with Azure AD connector requires end users to authenticate the connector by providing the Application ID and Base URL for the Azure Function.

Solution: Configure the HTTP with Azure AD connector in the Power Automate flow to authenticate using a service principal. This ensures that all authentication details are managed centrally, removing the need for end-user input.

Step 1: Register an App in Azure AD

  1. Open the Azure Portal and navigate to Azure Active Directory > App registrations.
  2. Create a new app registration and note the Application (Client) ID and Directory (Tenant) ID.
  3. Define the app’s API permissions, such as Function.ReadWrite, and grant admin consent to ensure all users inherit the permissions.

Step 2: Generate a Client Secret

  1. Go to the Certificates & secrets section in your app registration.
  2. Create a new client secret, and securely save the generated value for later use.

Step 3: Configure the HTTP with Azure AD Connector

  1. In Power Automate, open the HTTP with Azure AD connector settings.
  2. Enter the following details:
    • Base Resource URL: The Azure Function URL.
    • Tenant ID: The Azure AD Directory (Tenant) ID.
    • Client ID: The Application (Client) ID.
    • Client Secret: The client secret created earlier.

Step 4: Update Azure Function Authentication

  1. In the Azure Function settings, configure Authentication/Authorization to accept requests authenticated via Azure AD.
  2. Use token validation within the function to verify that incoming requests are authorized by the registered app.