Skip to content

Commit 335f827

Browse files
committed
Add the app settings updates
1 parent aa13fbe commit 335f827

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

articles/azure-functions/functions-deploy-container-apps.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,28 @@ If you're using a private registry, you need to include the fully qualified doma
137137
---
138138

139139
Specifying `--workload-profile-name "Consumption"` creates your app in an environment using the default `Consumption` workload profile, which costs the same as running in a Container Apps Consumption plan. When you first create the function app, it pulls the initial image from your registry.
140+
141+
## Update application settings
142+
143+
To enable the Functions host to connect to the default storage account using shared secrets, you must replace the `AzureWebJobsStorage` connection string setting with an equivalent setting that uses the user-assigned managed identity to connect to the storage account.
144+
145+
1. Remove the existing `AzureWebJobsStorage` connection string setting:
146+
147+
```azurecli
148+
az functionapp config appsettings delete --name `<APP_NAME>` --resource-group AzureFunctionsQuickstart-rg --setting-names AzureWebJobsStorage
149+
```
150+
151+
The [az functionapp config appsettings delete](/cli/azure/functionapp/config/appsettings#az-functionapp-config-appsettings-delete) command removes this setting from your app. Replace `<APP_NAME>` with the name of your function app.
152+
153+
1. Add equivalent settings, with an `AzureWebJobsStorage__` prefix, that define a user-assigned managed identity connection to the default storage account:
154+
155+
```azurecli
156+
clientId=$(az identity show --name <USER_IDENTITY_NAME> --resource-group AzureFunctionsQuickstart-rg --query 'clientId' -o tsv)
157+
az functionapp config appsettings set --name <APP_NAME> --resource-group AzureFunctionsQuickstart-rg --settings AzureWebJobsStorage__accountName=<STORAGE_NAME> AzureWebJobsStorage__credential=managedidentity AzureWebJobsStorage__clientId=$clientId
158+
```
140159
160+
In this example, replace `<APP_NAME>`, `<USER_IDENTITY_NAME>`, `<STORAGE_NAME>` with your function app name, the name of your identity, and the storage account name, respectively.
161+
141162
At this point, your functions are running in a Container Apps environment, with the required application settings already added. When needed, you can add other settings in your functions app in the standard way for Functions. For more information, see [Use application settings](functions-how-to-use-azure-function-app-settings.md#settings).
142163
143164
>[!TIP]

0 commit comments

Comments
 (0)