Jump to content

Use Azure Data Factory to invoke Logic App via Managed Identity Authentication


Recommended Posts

Guest KalyaniD
Posted

Scenario

 

 

 

 

Configure a Logic App (Consumption) with Azure Active Directory Open Authentication so that it can be called/invoked by an Azure Data Factory Web Activity via Managed Identity.

 

 

 

References

 

 

 

 

 

 

 

Services Used

 

 

 

 

  • Azure Logic Apps (Consumption)
  • Azure Data Factory

 

 

 

Steps

 

 

 

 

(1/2) Logic App Setup

 

 

 

1. Create a Logic App with an HTTP Trigger: Call, trigger, or nest logic apps by using Request triggers - Azure Logic Apps | Microsoft Learn

 

a. Make a note of the callable endpoint / webhook / trigger URL

 

 

 

largevv2px999.png.a52f55d5846f7ce2499c61b980b7acd8.png

 

 

 

2. On the Logic App, go to Authorization and add the Authorization Policy in the Logic App: Secure access and data - Azure Logic Apps | Microsoft Learn

 

 

Policy [Policy Name]
Policy Type AAD
Claims
Issuer

Sign in to your account[Tenant ID]/

Audience

https://management.azure.com/

 

 

 

 

 

largevv2px999.png.3b2224f961e3968cb23f0a9a2285619f.png

 

 

 

 

 

3. Add the Trigger Condition: Secure access and data - Azure Logic Apps | Microsoft Learn

 

  1. On the trigger, add the following Trigger Condition: @startsWith(triggerOutputs()?['headers']?['Authorization'], 'Bearer')

 

 

 

largevv2px999.png.e61cf645bca40fece952462484844b79.png

 

 

 

 

 

4. Include ‘Authorization’ header in request trigger outputs: Secure access and data - Azure Logic Apps | Microsoft Learn

 

  1. Open Code View
  2. Add and set the operationOptions property to IncludeAuthorizationHeadersInOutputs

 

 

 

Final Code View of the Logic App Trigger:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

"triggers": {

"manual": {

"conditions": [

{

"expression": "@startsWith(triggerOutputs()?['headers']?['Authorization'], 'Bearer')"

}

],

"inputs": {

"schema": {}

},

"kind": "Http",

"operationOptions": "IncludeAuthorizationHeadersInOutputs",

"type": "Request"

}

}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(2/2) Azure Data Factory Setup

 

 

 

5. Create a Web Activity in Azure Data Factory: Web Activity - Azure Data Factory & Azure Synapse | Microsoft Learn

 

  1. Enter the following required values (along with additional optional parameters) on the Web Activity.
  2. Remove the SAS token when entering Logic App URL on the Web Activity to ensure it will not use SAS Token authentication during invocation.

Property Sample Value Comments
URL https://prod-[xx].[region].logic.azure.com:443/workflows/[Workflow ID]/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0<removed> Copied from Step 1a

Method

POST, GET…
This can be changed on the Logic App trigger

Body





Valid JSON

Authentication

System Assigned Managed Identity

Resource

https://management.azure.com/

 

 

 

 

390x494vv2.png.42e6dbf98de3d0fcca7de0d2daba5c02.png

 

 

 

Testing the Integration

 

 

 

 

  1. Select Debug to test the pipeline and verify the Output shows a Succeeded status.

 

 

 

largevv2px999.png.db5977d61fa9d0b8443f3a4297746dba.png

 

 

 

 

 

  1. Refresh your Logic App’s Run History for the latest invocation.

 

 

 

883x204vv2.png.1817d3a1da102d6057a85f6093a96bd6.png

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...