Skip to content

Commit f0ece4e

Browse files
committed
minor wording changes
1 parent 34f887a commit f0ece4e

File tree

1 file changed

+72
-49
lines changed

1 file changed

+72
-49
lines changed

articles/azure-functions/durable/durable-functions-configure-managed-identity.md

Lines changed: 72 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,58 @@
11
---
2-
title: "Configure Durable Functions with managed identity"
3-
description: Configure Durable Functions with managed identity
2+
title: "Configure Durable Functions app with managed identity"
3+
description: Configure Durable Functions app with managed identity
44
author: naiyuantian
55
ms.topic: quickstart
66
ms.date: 07/30/2024
77
ms.author: azfuncdf
88
---
99

10-
# Configure Durable Functions with managed identity
10+
# Quickstart: Configure Durable Functions with managed identity
11+
12+
A managed identity from the access management service [Microsoft Entra ID](../../active-directory/fundamentals/active-directory-whatis.md) allows your app to access other Microsoft Entra protected resources, such as an Azure Storage account, without handling secrets manually. The identity is managed by the Azure platform, so you do *not* need to provision or rotate any secrets. The recommended way to authenticate access to Azure resources is through using such an identity.
13+
14+
In this quickstart, you complete steps to configure a Durable Functions app using the default **Azure Storage provider** to use identity-based connections for storage account access.
15+
16+
> [NOTE]
17+
> Managed identity is supported in [Durable Functions extension](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask) versions **2.7.0** and greater.
18+
19+
If you don't have an Azure account, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
20+
21+
## Prerequisites
22+
23+
To complete this quickstart, you need:
24+
25+
- An existing Durable Functions project created in the Azure portal or a local Durable Functions project deployed to Azure.
26+
- Familiarity running a Durable Functions app in Azure.
27+
28+
If you don't have an existing Durable Functions project deployed in Azure, we recommend that you start with one of the following quickstarts:
29+
30+
- [Create your first durable function - C#](durable-functions-create-first-csharp.md)
31+
- [Create your first durable function - JavaScript](quickstart-js-vscode.md)
32+
- [Create your first durable function - Python](quickstart-python-vscode.md)
33+
- [Create your first durable function - PowerShell](quickstart-powershell-vscode.md)
34+
- [Create your first durable function - Java](quickstart-java.md)
1135

12-
A managed identity from the access management service [Microsoft Entra ID](../../active-directory/fundamentals/active-directory-whatis.md) allows your app to access other Microsoft Entra protected resources without handling secrets manually. The identity is managed by the Azure platform, so you do *not* need to provision or rotate any secrets. The recommended way to authenticate access to Azure resources is through using such an identity. In this article, we show how to configure a Durable Functions app that is using the default Azure Storage provider to use a managed identity to access the storage account.
1336

1437
## Local development
1538

1639
### Use Azure Storage emulator
17-
When developing locally, it's recommended that you use Azurite, which is Azure Storage's local emulator. You can configure your app to the emulator by specifying `"AzureWebJobsStorage": "UseDevelopmentStorage = true"` in the local.settings.json.
40+
When developing locally, it's recommended that you use Azurite, which is Azure Storage's local emulator. Configure your app to the emulator by specifying `"AzureWebJobsStorage": "UseDevelopmentStorage = true"` in the local.settings.json.
1841

1942
### Identity-based connections for local development
43+
You can use an identity-based connection for local development if you prefer. Strictly speaking, a managed identity is only available to apps when executing on Azure. When configured to use identity-based connections, a locally executing app will utilize your developer credentials to authenticate against Azure resources. Then, when deployed on Azure, it will utilize your managed identity configuration instead.
2044

21-
You can still use an identity-based connection for local development if you prefer. Strictly speaking, a managed identity is only available to apps when executing on Azure. When configured to use identity-based connections, a locally executing app will utilize your developer credentials to authenticate with Azure resources. Then, when deployed on Azure, it will utilize your managed identity configuration instead.
22-
23-
When using your developer credentials, the connection attempts to get a token from the following locations, in the said order, for access to your Azure resources:
45+
When using developer credentials, the connection attempts to get a token from the following locations, in the said order, for access to your Azure resources:
2446

2547
- A local cache shared between Microsoft applications
2648
- The current user context in Visual Studio
2749
- The current user context in Visual Studio Code
2850
- The current user context in the Azure CLI
2951

30-
If none of these options are successful, an error occurs.
52+
If none of these options are successful, an error shows up regarding the app's inability to retrieve authentication token for your Azure resources.
3153

3254
#### Configure runtime to use local developer identity
33-
1. Specify the name of your Azure Storage account in local.settings.json:
55+
1. Specify the name of your Azure Storage account in local.settings.json, for example:
3456
```json
3557
{
3658
"IsEncrypted": false,
@@ -51,77 +73,78 @@ If none of these options are successful, an error occurs.
5173

5274
## Identity-based connections for app deployed to Azure
5375

54-
Managed identity is supported in [Durable Functions extension](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.DurableTask) versions **2.7.0** and greater.
55-
56-
### Prerequisites
57-
58-
The following steps assume that you're starting with an existing Durable Functions app and are familiar with how to operate it. In particular, this quickstart assumes that you have already:
59-
60-
* Deployed an app running in Azure that has Durable Functions.
61-
62-
If this isn't the case, we suggest you start with one of the following articles, which provides detailed instructions on how to achieve all the requirements above:
63-
64-
- [Create your first durable function - C#](durable-functions-create-first-csharp.md)
65-
- [Create your first durable function - JavaScript](quickstart-js-vscode.md)
66-
- [Create your first durable function - Python](quickstart-python-vscode.md)
67-
- [Create your first durable function - PowerShell](quickstart-powershell-vscode.md)
68-
- [Create your first durable function - Java](quickstart-java.md)
69-
7076
### Enable managed identity resource
7177

72-
Only one identity is needed for your function, either a **system assigned managed identity** or a **user assigned managed identity**. To enable a managed identity for your function application and learn more about the differences between the two identities, read the [detailed instructions](../../app-service/overview-managed-identity.md).
78+
To begin, enable a managed identity for your application. Your function app must have either a system-assigned managed identity or a user-assigned managed identity. To enable a managed identity for your function app, and to learn more about the differences between the two types of identities, see the [managed identity overview](../../app-service/overview-managed-identity.md).
7379

74-
### Assign Role-based Access Controls (RBAC) to managed identity
80+
### Assign access roles to the managed identity
7581

76-
Navigate to your app's Azure Storage resource on the Azure portal and [assign the following roles](/entra/identity/managed-identities-azure-resources/how-to-assign-access-azure-resource) to your managed identity resource:
82+
Navigate to your app's Azure Storage resource on the Azure portal and [assign](/entra/identity/managed-identities-azure-resources/how-to-assign-access-azure-resource) three role-based access control (RBAC) roles to your managed identity resource:
7783

7884
* Storage Queue Data Contributor
7985
* Storage Blob Data Contributor
8086
* Storage Table Data Contributor
8187

82-
You'll need to select assign access to "Managed identity" and then "+ Select members" to find your identity resource:
88+
To find your identity resource, select assign access to **Managed identity** and then **+ Select members**
8389

8490
![Assign access to managed identity](./media/durable-functions-configure-df-with-credentials/assign-access-managed-identity.png)
8591

8692
### Add managed identity configuration to your app
8793

88-
Navigate to your Azure Functions app’s **Configuration** page and perform the following changes:
94+
Before you can use your app's managed identity, make some changes to the app configuration:
8995

90-
1. Remove the default value "AzureWebJobsStorage".
96+
1. In the Azure portal, on your function app resource menu under **Settings**, select **Configuration**.
9197

98+
1. In the list of settings, select **AzureWebJobsStorage** and select the **Delete** icon.
9299
[ ![Screenshot of default storage setting.](./media/durable-functions-configure-df-with-credentials/durable-functions-managed-identity-scenario-01.png)](./media/durable-functions-configure-df-with-credentials/durable-functions-managed-identity-scenario-01.png#lightbox)
93100

94-
2. Link your Azure Storage account by adding **either one** of the following value settings (remember to click "Apply" after making the setting changes):
101+
1. Add a setting to link your Azure storage account to the application.
102+
103+
Use *one of the following methods* depending on the cloud that your app runs in:
104+
105+
- **Azure cloud**: If your app runs in *public Azure*, add a setting that identifies an Azure storage account name:
95106

96-
* Option 1:
97-
**AzureWebJobsStorage__accountName**: For example: `mystorageaccount123`
107+
- `AzureWebJobsStorage__<accountName>`
98108

99-
* Option 2:
100-
**AzureWebJobsStorage__blobServiceUri**: Example: `https://mystorageaccount123.blob.core.windows.net/`
109+
Example: `AzureWebJobsStorage__mystorageaccount123`
101110

102-
**AzureWebJobsStorage__queueServiceUri**: Example: `https://mystorageaccount123.queue.core.windows.net/`
111+
- **Non-Azure cloud**: If your application runs in a cloud outside of Azure, you must add a specific service URI (*an endpoint*) for the storage account instead of an account name.
103112

104-
**AzureWebJobsStorage__tableServiceUri**: Example: `https://mystorageaccount123.table.core.windows.net/`
113+
> [!NOTE]
114+
> If you are using [Azure Government](../../azure-government/documentation-government-welcome.md) or any other cloud that's separate from public Azure, you must use the option to provide a specific service URL. For more information on using Azure Storage with Azure Government, see the [Develop by using the Storage API in Azure Government](../../azure-government/documentation-government-get-started-connect-to-storage.md).
105115
106-
> [!NOTE]
107-
> If you are using [Azure Government](../../azure-government/documentation-government-welcome.md) or any other cloud that's separate from global Azure, then you will need to use this second option to provide specific service URLs. The values for these settings can be found in the storage account under the **Endpoints** tab. For more information on using Azure Storage with Azure Government, see the [Develop with Storage API on Azure Government](../../azure-government/documentation-government-get-started-connect-to-storage.md) documentation.
116+
117+
- `AzureWebJobsStorage__blobServiceUri`
118+
119+
Example: `https://mystorageaccount123.blob.core.windows.net/`
120+
121+
- `AzureWebJobsStorage__queueServiceUri`
122+
123+
Example: `https://mystorageaccount123.queue.core.windows.net/`
124+
125+
- `AzureWebJobsStorage__tableServiceUri`
126+
127+
Example: `https://mystorageaccount123.table.core.windows.net/`
128+
129+
You can get the values for these URI variables in the storage account information on the Endpoints tab.
108130

109131
![Screenshot of endpoint sample.](media/durable-functions-configure-df-with-credentials/durable-functions-managed-identity-scenario-02.png)
110132

111-
3. Finalize your managed identity configuration (remember to click "Apply" after making the setting changes):
133+
1. Finish your managed identity configuration (remember to click "Apply" after making the setting changes):
112134

113-
* If **system-assigned identity** should be used, then specify nothing else.
135+
* If you use a *system-assigned identity*, make no other changes.
114136

115-
* If **user-assigned identity** should be used, then add the following app settings values in your app configuration:
116-
* **AzureWebJobsStorage__credential**: managedidentity
137+
* If you use a *user-assigned identity*, add the following settings in your app configuration:
117138

118-
* **AzureWebJobsStorage__clientId**: (This is a GUID value that you obtain from your managed identity resource)
139+
* **AzureWebJobsStorage__credential**, enter **managedidentity**
140+
141+
* **AzureWebJobsStorage__clientId**, get this GUID value from your managed identity resource
119142

120143
![Screenshot of user identity client id.](media/durable-functions-configure-df-with-credentials/durable-functions-managed-identity-scenario-03.png)
121144

122-
> [!NOTE]
123-
> Durable Functions does not support `managedIdentityResourceId` when using user-assigned identity. Use `clientId` instead.
124-
145+
> [!NOTE]
146+
> Durable Functions does *not* support `managedIdentityResourceId` when using user-assigned identity. Use `clientId` instead.
147+
125148

126149

127150

0 commit comments

Comments
 (0)