Azure / Azure/azure-quickstart-templates
App Service and Slot Syncing
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
[101-webapp-custom-deployment-slots](https://github.com/Azure/azure-quickstart-templates/tree/master/101-webapp-custom-deployment-slots)
### Issue Details
I was looking for a template that would show how to create a web app and slot and keep that slot always in sync with the web app settings. That includes everything from app settings, to identity settings, and so on. As I found out though, this template only keeps things in sync during the initial deployment. If I do a subsequent deployment where I've added an app setting (for instance) or turned on managed identity (MSI) on the Microsoft.Web/sites resource the slot does not also get the change, but I expect it to.
After sending in a support ticket, I found that I just have to duplicate the entire config on both the web app and the web app slot. I would like to see a template added for this as I imagine it could be common. I would also love to see a new feature on the slots, if possible, that makes sure they always stay in sync from the deployment perspective (maybe not when changes are made in the UI).
### Sample of my template
```json
{
"type": "Microsoft.Web/sites",
"kind": "app",
"name": "[variables('appName')]",
"apiVersion": "2016-08-01",
"location": "[resourceGroup().location]",
"identity": { "type": "SystemAssigned" },
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('spName'))]",
"siteConfig": "[variables('commonSiteConfig')]",
"clientAffinityEnabled": false,
"httpsOnly": true
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('spName'))]"
]
},
{
"apiVersion": "2016-08-01",
"name": "[variables('slotName')]",
"type": "Microsoft.Web/sites/slots",
"location": "[resourceGroup().location]",
"identity": { "type": "SystemAssigned" },
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('appName'))]"
],
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('spName'))]",
"siteConfig": "[variables('commonSiteConfig')]",
"clientAffinityEnabled": false,
"httpsOnly": true
}
}
]
```
whereas I would prefer something like
```json
{
"type": "Microsoft.Web/sites",
"kind": "app",
"name": "[variables('appName')]",
"apiVersion": "2016-08-01",
"location": "[resourceGroup().location]",
"identity": { "type": "SystemAssigned" },
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('spName'))]",
"siteConfig": "[variables('commonSiteConfig')]",
"clientAffinityEnabled": false,
"httpsOnly": true
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('spName'))]"
]
},
{
"apiVersion": "2016-08-01",
"name": "[variables('slotName')]",
"type": "Microsoft.Web/sites/slots",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('appName'))]"
],
"properties": {
"syncWithApp": true
}
}
]
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the linked 101-webapp-custom-deployment-slots template and compare its Microsoft.Web/sites and Microsoft.Web/sites/slots definitions with the sample ARM JSON. Verify behavior across an initial and subsequent deployment that changes app settings or managed identity; completion would require either a template demonstrating the requested synchronization or a confirmed implementation path for slot syncing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100