Skip to content

Commit 47557e1

Browse files
author
ecfan
committed
Update UX and fix steps for finding the correct app ID to use
1 parent c781b4d commit 47557e1

File tree

7 files changed

+49
-42
lines changed

7 files changed

+49
-42
lines changed

articles/logic-apps/logic-apps-azure-functions.md

Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: logic-apps
55
ms.suite: integration
66
ms.reviewer: estfan, azla
77
ms.topic: how-to
8-
ms.date: 05/06/2024
8+
ms.date: 05/07/2024
99
---
1010

1111
# 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
239239
240240
<a name="enable-authentication-functions"></a>
241241
242-
## Enable authentication for function calls (Consumption workflows only)
242+
## Enable authentication for Azure function calls (Consumption workflows only)
243243
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.
245245
246246
> [!NOTE]
247247
>
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.
251251
252-
For more information, review the following documentation:
252+
For more information, see the following documentation:
253253
254254
* [Authenticate access with managed identities](create-managed-service-identity.md)
255255
* [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
300300
301301
<a name="find-required-values"></a>
302302
303-
<a name='find-the-required-values-to-set-up-azure-ad-authentication-consumption-workflows-only'></a>
304-
305303
### Find the required values to set up Microsoft Entra authentication (Consumption workflows only)
306304
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).
308308
309309
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).
311310
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).
313312
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.
315322
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**.
317324
318-
* **System assigned**
325+
1. Copy and save your tenant ID for later use, for example:
319326
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":::
321328
322-
![Screenshot showing the Consumption logic app "Identity" pane with the "System assigned" tab selected.](./media/logic-apps-azure-functions/system-identity-consumption.png)
329+
<a name="find-object-id"></a>
323330
324-
* **User assigned**
331+
#### Find the object ID or client ID for your logic app's managed identity
325332
326-
1. For the user-assigned identity, select the identity to 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.
327334
328-
![Screenshot showing the Consumption logic app "Identity" pane with the "User assigned" tab selected.](./media/logic-apps-azure-functions/user-identity-consumption.png)
335+
1. On the logic app menu, under **Settings**, select **Identity**, and then select either **System assigned** or **User assigned**.
329336
330-
1. On the managed identity's **Overview** pane, copy the identity's **Client ID**, for example:
337+
- **System assigned**
331338
332-
![Screenshot showing the user-assigned identity's "Overview" pane with the client ID selected.](./media/logic-apps-azure-functions/user-identity-client-id.png)
339+
Copy the identity's **Object (principal) ID**:
333340
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":::
335342
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**
337344
338-
1. In the [Azure portal](https://portal.azure.com), find and open your Enterprise application.
345+
1. Select the identity:
339346
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":::
341348
342-
1. Under **Properties**, find and copy the **Application ID** to [create an app registration for your function app](#create-app-registration).
349+
1. Copy the identity's **Object (principal) ID**:
343350
344-
:::image type="content" source="media/logic-apps-azure-functions/enterprise-application-id.png" alt-text="{alt-text}" lightbox="media/logic-apps-azure-functions/enterprise-application-id.png":::
351+
:::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":::
345352
346-
<a name="find-tenant-id"></a>
353+
<a name="find-enterprise-app-application-id"></a>
347354
348-
#### Find the tenant ID for your Microsoft Entra ID
355+
### Find the application ID for the associated Azure Enterprise application
349356
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.
351358
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.
353360
354-
1. On the Microsoft Entra tenant menu, select **Overview**.
361+
1. On the tenant menu, under **Manage**, select **Enterprise applications**.
355362
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**:
357364
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":::
359366
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).
361368
362369
<a name="create-app-registration"></a>
363370
364-
### Create app registration for your function app (Consumption workflows only)
371+
### Add identity provider for your function app (Consumption workflows only)
365372
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.
367374
368375
1. In the [Azure portal](https://portal.azure.com), open your function app.
369376
370377
1. On the function app menu, under **Settings**, select **Authentication**, and then select **Add identity provider**.
371378
372-
![Screenshot showing function app menu with "Authentication" pane and "Add identity provider" selected.](./media/logic-apps-azure-functions/open-authentication-pane.png)
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":::
373380
374381
1. On the **Add an identity provider** pane, under **Basics**, from the **Identity provider** list, select **Microsoft**.
375382
376383
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.
377384
378385
| Property | Required | Value | Description |
379386
|----------|----------|-------|-------------|
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. |
381388
| **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. |
382389
| **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-
| **Allowed token audiences** | No | <*application-ID-URI*> | The application ID URI (resource ID) for the function 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+
| **Allowed token audiences** | No | <*application-ID-URI*> | The application ID URI (resource ID) for the function 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. |
384391

385392
At this point, your version looks similar to this example:
386393

@@ -394,7 +401,7 @@ After you find the object ID (system-assigned) or client ID (user-assigned) for
394401

395402
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.
396403

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.
398405

399406
:::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":::
400407

57.5 KB
Loading
Binary file not shown.
57.1 KB
Loading
Binary file not shown.
-3.64 KB
Loading
37.1 KB
Loading

0 commit comments

Comments
 (0)