Skip to content

Add ARM template example for setting app settings in Azure App Service #126294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions articles/app-service/configure-common.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,42 @@ To make one or more app settings slot specific, use [Set-AzWebAppSlotConfigName]
Set-AzWebAppSlotConfigName -ResourceGroupName <group-name> -Name <app-name> -AppSettingNames <setting-name1>,<setting-name2>,...
```

# [ARM Template](#tab/ARM)

Set one or more app settings by using Azure Resource Manager templates (ARM templates):

```json
{
"type": "Microsoft.Web/sites",
"apiVersion": "2024-04-01",
"name": "[parameters('webAppName')]",
"location": "[parameters('location')]",
"properties": {
"httpsOnly": true,
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanPortalName'))]",
"siteConfig": {
"linuxFxVersion": "[parameters('linuxFxVersion')]",
"minTlsVersion": "1.2",
"ftpsState": "FtpsOnly",
"appSettings": [
{
"name": "<setting-name1>",
"value": "<value1>"
}
]
}
},
"identity": {
"type": "SystemAssigned"
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanPortalName'))]"
]
},
```

Please refer to [**Microsoft.Web/sites**](/azure/templates/microsoft.web/sites) for more information.

-----

### Edit app settings in bulk
Expand Down Expand Up @@ -200,6 +236,46 @@ az webapp config appsettings set --resource-group <group-name> --name <app-name>

It's not possible to edit app settings in bulk by using a JSON file with Azure PowerShell.

# [ARM Template](#tab/ARM)

Set one or more app settings by using Azure Resource Manager templates (ARM templates):

```json
{
"type": "Microsoft.Web/sites",
"apiVersion": "2024-04-01",
"name": "[parameters('webAppName')]",
"location": "[parameters('location')]",
"properties": {
"httpsOnly": true,
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanPortalName'))]",
"siteConfig": {
"linuxFxVersion": "[parameters('linuxFxVersion')]",
"minTlsVersion": "1.2",
"ftpsState": "FtpsOnly",
"appSettings": [
{
"name": "<setting-name1>",
"value": "<value1>"
},
{
"name": "<setting-name2>",
"value": "<value2>"
}
]
}
},
"identity": {
"type": "SystemAssigned"
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanPortalName'))]"
]
},
```

Please refer to [**Microsoft.Web/sites**](/azure/templates/microsoft.web/sites) for more information.

-----

## Configure connection strings
Expand Down