I'm trying to get into that Visual Studio Resource Group template. So far it's looking good, and I have added some appsettings for a web app, but my question is, how can I make them deployment slot specific? Is there something in the json for the template or the parameter file?
相关问题
- Removing VHD's from Azure Resource Manager aft
- How to resolve SAS URL for Storage Account in RM T
- Azure ARM template nested template deployment won&
- Is It possible to build asp.net core project using
- Visual Studio — does not create exe file
相关文章
- Build errors of missing packages in Visual Studio
- Visual Studio 2015 JSX/ES2015 syntax highlighting
- Edit & Continue doesn't work
- Git SubModule Visual Studio
- Cannot add a Data Source in web project using the
- Microsoft Visual Studio 2015 is busy
- Predefined type System.Object is not defined or im
- Visual Studio Build Error “csc.exe” exited with co
Please have a try to add the json code snipped in the ARM template. I have tested it. It works successfully.
The following are my detail steps:
1. Create a new Azure Resource group project (More detail please refer to document)
2. The Demo just for the Azure Website Slot App setting configuration, so remove the other resource from the project.
3. Add the Slot configuration into the deployment file
4. Publish the Deployment
The full json code :
We also can get the slot type from the azure resource ,if you have any slots on the Azure portal. I also find a similar thread in the SO.
The accepted answer is correct, but leaves out an important piece of information. Under its current implementation, when swapping slots the AppSettings configuration for the slot will be swapped along with the deployment. If you are concerned about slot-specific configuration then this probably is not desirable for you.
To make the configuration "Sticky" to a slot, use the following resource in your ARM template. Note that the slotconfignames section has been added to the ARM template snippet from Tom's answer above.
This will make AppSettingKey1 and AppSettingKey2 sticky to the Staging slot (They will not swap along with the deployment).
See "Azure Resource Manager Templates Tips and Tricks" from Anthony Chu for more details on sticky slot settings as well as other ARM template tips.
"slotconfignames" should only be specified on production slot to tell which settings that are slot specific even if they don´t even exist on the slot. The actual value for the slot specific setting should still be specified on the slot settings.
]