I'm looking to implement a staging slot for an Azure function. The approach I'm attempting to take is to define the slot in the ARM template along with the rest of the infrastructure and the app settings. I'll then deploy the app to the staging slot and perform a slot swap using az
.
The problem I have is that the app settings sometimes contains settings specific to the version of the app running. Within the ARM template, I want to apply new application setting to the staging slot whilst retaining the currently set value for some of the settings on the production slot. These production slot settings should then only be updated when the swap occurs in the next couple of steps.
I've not been able to find a way to express this within ARM. I've attempted to use reference to set the appsetting property to be its current value. I'm not sure if this is possible but I get a generic validation error with no detail on why it's failed.
Is there a way to leave some appsettings unchanged in ARM?
UPDATE
Here is a snippet of my attempt to retain the existing value of the config.
{
"type": "Microsoft.Web/sites/config",
"name": "MyApp/appsettings",
"apiVersion": "2019-08-01",
"properties": {
"MY_APP_CONFIG1": "[reference(resourceId('Microsoft.Web/sites/config', 'MyApp', 'appsettings'), '2019-08-01', 'Full').properties.MY_APP_CONFIG1]"
}
}
The reference function introduced here fails the template validation. Only information it gives me is The deployment validation failed
.