Search code examples
azureazure-functionsazure-resource-managerazure-deployment-slots

How to conifgure specify sticky slot settings for Azure function using ARM template


I have app settings that need to be sticky to deployment slots for Azure Function.

I followed example provided from below posting.

How to use sticky staging slots in Azure Arm Templates

However, when the resources are deployed onto resource through VSTS, it keeps failing due to 'conflict' (https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-common-deployment-errors).

I currently have separate resource templates for "Microsoft.Web/Sites" and "Microsoft.Web/Sites/Config"

App settings are specified under "siteConfig" properties for "Microsoft.Web/Sites" template.

If "appSettingNames" is a type of config, can I list it under siteConfig for "Microsoft.Web/Sites" like below?

    {
        "type": "Microsoft.Web/sites",
        "kind": "functionapp",
        "name": "[parameters('name')]",
        "apiVersion": "2016-08-01",
        "location": "[parameters('location')]",
        "properties": {
            "siteConfig": {
                "appSettings": "[parameters('appSettings')]",
                "alwaysOn": true,
                "appSettingNames": "[parameters('appSettingNames')]"
            }
        },
        "dependsOn": [],
        "resources": []
    }

Where as parameter 'appSettingNames' is an array parameter and look like below: ["setting1", "setting2", "setting3"].

if there is any example for specifying this configuration. it would be really helpful

Thanks


Solution

  • For your issue, 'appSettingNames' is not a type of config. So you can not set the template you post. And you can see all the types of config follow this link: SiteConfig object.