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/azure-functions/how-to-create-function-azure-cli.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -184,17 +184,29 @@ In Azure Functions, a function project is a container for one or more individual
184
184
185
185
To enable the Functions host to connect to the default storage account using shared secrets, you must replace the `AzureWebJobsStorage` connection string setting with a complex setting, prefixed with `AzureWebJobsStorage`, that uses the user-assigned managed identity to connect to the storage account.
186
186
187
-
1. Remove the existing `AzureWebJobsStorage` connection string setting:
187
+
1. Use this script to get the client ID of the user-assigned managed identity, and with it define a managed identity connections to storage and Application Insights:
188
+
189
+
```azurecli
190
+
clientId=$(az identity show --name func-host-storage-user \
In this script, replace `<APP_NAME>` and `<STORAGE_NAME>` with the names of your function app and storage account, respectively.
199
+
190
200
191
-
The [az functionapp config appsettings delete](/cli/azure/functionapp/config/appsettings#az-functionapp-config-appsettings-delete) command removes this setting from your app.
201
+
1. Run the [az functionapp config appsettings delete](/cli/azure/functionapp/config/appsettings#az-functionapp-config-appsettings-delete) command to remove the existing `AzureWebJobsStorage` connection string setting, which contains a shared secret key:
192
202
193
-
1. Add equivalent settings, with an `AzureWebJobsStorage__` prefix, that define a user-assigned managed identity connection to the default storage account:
At this point, the Functions host is able to connect to the storage account securely using managed identities. You can now deploy your project code to the Azure resources.
In this example, replace `<APP_NAME>` with the names of your function app.
208
+
209
+
At this point, the Functions host is able to connect to the storage account securely using managed identities instead of shared secrets. You can now deploy your project code to the Azure resources.
0 commit comments