You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/logic-apps/logic-apps-azure-functions.md
+49-42Lines changed: 49 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ services: logic-apps
5
5
ms.suite: integration
6
6
ms.reviewer: estfan, azla
7
7
ms.topic: how-to
8
-
ms.date: 05/06/2024
8
+
ms.date: 05/07/2024
9
9
---
10
10
11
11
# Call Azure Functions from workflows in Azure Logic Apps
@@ -239,17 +239,17 @@ To call an Azure function from your workflow, you can add that functions like an
239
239
240
240
<a name="enable-authentication-functions"></a>
241
241
242
-
## Enable authentication for function calls (Consumption workflows only)
242
+
## Enable authentication for Azure function calls (Consumption workflows only)
243
243
244
-
Your Consumption workflow can authenticate function calls and access to resources protected by Microsoft Entra ID by using a [managed identity](../active-directory/managed-identities-azure-resources/overview.md). This managed identity can authenticate access without having to sign in and provide credentials or secrets. Azure manages this identity for you and helps secure your credentials because you don't have to provide or rotate secrets. You can set up the system-assigned identity or a manually created, user-assigned identity at the logic app resource level. The function that's called from your workflow can use the same identity for authentication.
244
+
Your Consumption workflow can use a [managed identity](../active-directory/managed-identities-azure-resources/overview.md) to authenticate an Azure function call and access resources protected by Microsoft Entra ID. The managed identity can authenticate access without you having to sign in and provide credentials or secrets. Azure manages this identity for you and helps secure your credentials because you don't have to provide or rotate secrets. You can set up the system-assigned identity or a manually created, user-assigned identity at the logic app resource level. The Azure function that's called from your workflow can use the same managed identity for authentication.
245
245
246
246
> [!NOTE]
247
247
>
248
-
> Currently, only Consumption workflows support authentication for Azure function
249
-
> calls using a managed identity and Microsoft Entra authentication. Standard workflows
250
-
> currently don't include this support when using the Azure Functions connector.
248
+
> Only Consumption workflows support authentication for an Azure function call using
249
+
> a managed identity and Microsoft Entra authentication. Standard workflows currently
250
+
> don't include this support when you use the action to call an Azure function.
251
251
252
-
For more information, review the following documentation:
252
+
For more information, see the following documentation:
253
253
254
254
* [Authenticate access with managed identities](create-managed-service-identity.md)
255
255
* [Add authentication to outbound calls](logic-apps-securing-a-logic-app.md#add-authentication-outbound)
@@ -300,87 +300,94 @@ For your function to use your Consumption logic app's managed identity, you must
### Find the required values to set up Microsoft Entra authentication (Consumption workflows only)
306
304
307
-
Before you can set up your function app to use Microsoft Entra authentication, you need to find and save the following values by following the steps in this section.
305
+
Before you can set up your function app to use the managed identity and Microsoft Entra authentication, you need to find and save the following values by following the steps in this section.
306
+
307
+
1. [Find the tenant ID for your Microsoft Entra tenant](#find-tenant-id).
308
308
309
309
1. [Find the object ID or client ID for your logic app's managed identity](#find-object-id).
310
-
1. [Find the tenant ID for your Microsoft Entra ID](#find-tenant-id).
311
310
312
-
<a name="find-object-id"></a>
311
+
1. [Find the application ID for the Enterprise application associated with the managed identity](#find-application-id).
313
312
314
-
#### Find the object ID or client ID for your logic app's managed identity
313
+
<a name="find-tenant-id"></a>
314
+
315
+
#### Find the tenant ID for your Microsoft Entra tenant
316
+
317
+
Either run the PowerShell command named [**Get-AzureAccount**](/powershell/module/servicemanagement/azure/get-azureaccount), or in the Azure portal, follow these steps:
318
+
319
+
1. In the [Azure portal](https://portal.azure.com), open your Microsoft Entra tenant.
320
+
321
+
This guide uses **Fabrikam** as the example tenant.
315
322
316
-
1. After your Consumption logic app has its managed identity enabled, on the logic app menu, under **Settings**, select **Identity**, and then select either **System assigned** or **User assigned**.
323
+
1. On the tenant menu, select **Overview**.
317
324
318
-
* **System assigned**
325
+
1. Copy and save your tenant ID for later use, for example:
319
326
320
-
For the system-assigned identity, copy the identity's **Object (principal) ID**, for example:
327
+
:::image type="content" source="media/logic-apps-azure-functions/tenant-id.png" alt-text="Screenshot shows Microsoft Entra ID Properties page with tenant ID's copy button selected." lightbox="media/logic-apps-azure-functions/tenant-id.png":::
321
328
322
-

329
+
<a name="find-object-id"></a>
323
330
324
-
* **User assigned**
331
+
#### Find the object ID or client ID for your logic app's managed identity
325
332
326
-
1. For the user-assigned identity, select the identityto find the client ID, for example:
333
+
After you enable the managed idenity for your Consumption logic app resource, find the object ID for the system-assigned identity or the client ID for the user-assigned identity. You'll use either ID to find the associated Enterprise application in your Entra tenant.
327
334
328
-

335
+
1. On the logic app menu, under **Settings**, select **Identity**, and then select either **System assigned** or **User assigned**.
329
336
330
-
1. On the managed identity's **Overview** pane, copy the identity's **Client ID**, for example:
337
+
- **System assigned**
331
338
332
-

339
+
Copy the identity's **Object (principal) ID**:
333
340
334
-
### Find application ID for Azure Enterprise application
341
+
:::image type="content" source="media/logic-apps-azure-functions/system-identity-consumption.png" alt-text="Screenshot shows Consumption logic app's Identity page with selected tab named System assigned." lightbox="media/logic-apps-azure-functions/system-identity-consumption.png":::
335
342
336
-
If you want to use an [Azure Enterprise application](/entra/identity/enterprise-apps/add-application-portal), rather than a managed identity to create the app registration to use for authentication, find, copy, and use the **Application ID** from your Enterprise application to later create an app registration for your function app.
343
+
- **User assigned**
337
344
338
-
1. In the [Azure portal](https://portal.azure.com), find and open your Enterprise application.
345
+
1. Select the identity:
339
346
340
-
1. On the application menu, select **Overview**.
347
+
:::image type="content" source="media/logic-apps-azure-functions/user-identity-consumption.png" alt-text="Screenshot shows Consumption logic app's Identity page with selected tab named User assigned." lightbox="media/logic-apps-azure-functions/user-identity-consumption.png":::
341
348
342
-
1. Under **Properties**, find and copy the **Application ID** to [create an app registration for your function app](#create-app-registration).
:::image type="content" source="media/logic-apps-azure-functions/user-identity-object-id.png" alt-text="Screenshot shows Consumption logic app's user-assigned identity Overview page with the object (principal) ID selected." lightbox="media/logic-apps-azure-functions/user-identity-object-id.png":::
345
352
346
-
<a name="find-tenant-id"></a>
353
+
<a name="find-enterprise-app-application-id"></a>
347
354
348
-
#### Find the tenant ID for your Microsoft Entra ID
355
+
### Find the application ID for the associated Azure Enterprise application
349
356
350
-
To find your Microsoft Entra tenant ID, either run the PowerShell command named [**Get-AzureAccount**](/powershell/module/servicemanagement/azure/get-azureaccount), or in the Azure portal, follow these steps:
357
+
When you enable a managed identity on your logic app resource, Azure automatically creates an associated [Azure Enterprise application](/entra/identity/enterprise-apps/add-application-portal). You now need to find the associated Enterprise application and copy its **Application ID**. Later, you use this application ID to add an identity provider for your function app by creating an app registration.
351
358
352
-
1. In the [Azure portal](https://portal.azure.com), open your Microsoft Entra tenant. These steps use **Fabrikam** as the example tenant.
359
+
1. In the [Azure portal](https://portal.azure.com), find and open your Entra tenant.
353
360
354
-
1. On the Microsoft Entra tenant menu, select **Overview**.
361
+
1. On the tenant menu, under **Manage**, select **Enterprise applications**.
355
362
356
-
1. Copy and save your tenant ID for later use, for example:
363
+
1. On the **All applications** page, in the search box, enter the object ID for your managed identity. From the results, find the matching enterprise application, and copy the **Application ID**:
357
364
358
-
:::image type="content" source="media/logic-apps-azure-functions/tenant-id.png" alt-text="Screenshot shows Microsoft Entra ID Properties page with tenant ID's copy button selected." lightbox="media/logic-apps-azure-functions/tenant-id.png":::
365
+
:::image type="content" source="media/logic-apps-azure-functions/find-enterprise-application-id.png" alt-text="Screenshot shows Entra tenant page named All applications, with enterprise application object ID in search box, and selected matching application ID." lightbox="media/logic-apps-azure-functions/find-enterprise-application-id.png":::
359
366
360
-
<a name="find-enterprise-app-application-id"></a>
367
+
1. Now, use the copied application ID to [add an identity provider to your function app](#create-app-registration).
361
368
362
369
<a name="create-app-registration"></a>
363
370
364
-
### Create app registration for your function app (Consumption workflows only)
371
+
### Add identity provider for your function app (Consumption workflows only)
365
372
366
-
After you find the object ID (system-assigned) or client ID (user-assigned) for your Consumption logic app's managed identity and the tenant ID for your Microsoft Entra ID, you can set up your function app to use Microsoft Entra authentication by creating an app registration.
373
+
Now that you have the tenant ID and the application ID, you can set up your function app to use Microsoft Entra authentication by adding an identity provider and creating an app registration.
367
374
368
375
1. In the [Azure portal](https://portal.azure.com), open your function app.
369
376
370
377
1. On the function app menu, under **Settings**, select **Authentication**, and then select **Add identity provider**.
371
378
372
-

379
+
:::image type="content" source="media/logic-apps-azure-functions/add-identity-provider.png" alt-text="Screenshot shows function app menu with Authentication page and selected option named Add identity provider." lightbox="media/logic-apps-azure-functions/add-identity-provider.png":::
373
380
374
381
1. On the **Add an identity provider** pane, under **Basics**, from the **Identity provider** list, select **Microsoft**.
375
382
376
383
1. Under **App registration**, for **App registration type**, select **Provide the details of an existing app registration**, and enter the values that you previously saved.
377
384
378
385
| Property | Required | Value | Description |
379
386
|----------|----------|-------|-------------|
380
-
| **Application (client) ID** | Yes | <*object-client-or-application-ID*> | The unique identifier to use for this app registration. For example, you can use any of the following options: <br><br>- The object ID for your logic app's system-assigned managed identity <br>- The client ID for your logic app's user-assigned managed identity <br>- The application ID for an Enterprise application |
387
+
| **Application (client) ID** | Yes | <*application-ID*> | The unique identifier to use for this app registration. For this example, use the application ID that you copied for the Enterprise application associated with your managed identity. |
381
388
| **Client secret** | Optional, but recommended | <*client-secret*> | The secret value that the app uses to prove its identity when requesting a token. The client secret is created and stored in your app's configuration as a slot-sticky [application setting](../app-service/configure-common.md#configure-app-settings) named **MICROSOFT_PROVIDER_AUTHENTICATION_SECRET**. To manage the secret in Azure Key Vault instead, you can update this setting later to use [Key Vault references](../app-service/app-service-key-vault-references.md). <br><br>- If you provide a client secret value, sign-in operations use the hybrid flow, returning both access and refresh tokens. <br><br>- If you don't provide a client secret, sign-in operations use the OAuth 2.0 implicit grant flow, returning only an ID token. <br><br>These tokens are sent by the provider and stored in the EasyAuth token store. |
382
389
| **Issuer URL** | No | **<*authentication-endpoint-URL*>/<*Entra-tenant-ID*>/v2.0** | This URL redirects users to the correct Microsoft Entra tenant and downloads the appropriate metadata to determine the appropriate token signing keys and token issuer claim value. For apps that use Azure AD v1, omit **/v2.0** from the URL. <br><br>For this scenario, use the following URL: **`https://sts.windows.net/`<*Entra-tenant-ID*>** |
383
-
|**Allowedtokenaudiences**|No|<*application-ID-URI*>|TheapplicationIDURI (resource ID) forthefunction app. For a cloud or server app where you want to allow authentication tokens from a web app, add the application ID URI for the web app. The configured client ID is always implicitly considered as an allowed audience. <br><br>For this scenario, the value is **`https://management.azure.com`**. Later, you can use the same URI in the **Audience** property when you [set up your function action in your workflow to use the managed identity](create-managed-service-identity.md#authenticate-access-with-identity). <p><p>**Important**: The application ID URI (resource ID) must exactly match the value that Microsoft Entra ID expects, including any required trailing slashes. |
390
+
|**Allowedtokenaudiences**|No|<*application-ID-URI*>|TheapplicationIDURI (resource ID) forthefunction app. For a cloud or server app where you want to allow authentication tokens from a web app, add the application ID URI for the web app. The configured client ID is always implicitly considered as an allowed audience. <br><br>For this scenario, the value is **`https://management.azure.com`**. Later, you can use the same URI in the **Audience** property when you [set up your function action in your workflow to use the managed identity](create-managed-service-identity.md#authenticate-access-with-identity). <br><br>**Important**: The application ID URI (resource ID) must exactly match the value that Microsoft Entra ID expects, including any required trailing slashes. |
384
391
385
392
At this point, your version looks similar to this example:
386
393
@@ -394,7 +401,7 @@ After you find the object ID (system-assigned) or client ID (user-assigned) for
394
401
395
402
When you're done, the **Authentication** page now lists the identity provider and the app registration's application (client) ID. Your function app can now use this app registration for authentication.
396
403
397
-
1. Copy the **Application (client) ID** value to use later in the Azure Functions action's **Audience** property for your workflow.
404
+
1. Copy the app registration's **App (client) ID** to use later in the Azure Functions action's **Audience** property for your workflow.
398
405
399
406
:::image type="content" source="media/logic-apps-azure-functions/identity-provider-application-id.png" alt-text="Screenshot shows new identity provider for function app" lightbox="media/logic-apps-azure-functions/identity-provider-application-id.png":::
0 commit comments