Azure resource manager template website app settings

后端 未结 4 1383
慢半拍i
慢半拍i 2021-01-05 16:35

I am trying to add app settings to my Azure Website via the JSON template files as part of the Azure Resource Manager.

In an Azure Resource template json file, there

4条回答
  •  半阙折子戏
    2021-01-05 17:09

    Adding as a sub/child resource fails to work using the later API's, however adding a "siteConfig" property with an "appSettings" element, as stated above, seems to work. I am using the API Version 2016-03-01

    {
            "type": "Microsoft.Web/sites",
            "name": "[variables('webappName')]",
            "apiVersion": "2016-03-01",
            "location": "[parameters('location')]",
            "tags": "[parameters('tags')]",
            "kind": "app",
            "properties": {
                "name": "[variables('webappName')]",
                "serverFarmId": "[variables('targetResourceId')]",
                "hostingEnvironment": "[parameters('hostingEnvironment')]",
                "netFrameworkVersion": "[parameters('netFrameworkVersion')]",
                "use32BitWorkerProcess": false,
                "webSocketsEnabled": true,
                "alwaysOn": true,
                "managedPipelineMode": "integrated",
                "clientAffinityEnabled": true,
                "hostNameSslStates": [
                    {
                        "name": "[variables('hostName')]",
                        "sslState": "SniEnabled",
                        "thumbprint": "[parameters('certThumb')]",
                        "ipBasedSslState": "NotConfigured",
                        "hostType": "Standard"
                    }
                ],
                "siteConfig": {
                   "appSettings": "[variables('appSettings')]"
                }
            },
            "dependsOn": [
                "[concat('Microsoft.Web/serverfarms/', variables('hostingPlanName'))]"
            ],
            "resources": []
        }
    

    And my variable looks like this.....

    "appSettings": [
                {
                    "name": "WEBSITE_NODE_DEFAULT_VERSION",
                    "value": "8.9.3"
                },
                {
                    "name": "WEBSITE_PRIVATE_EXTENSIONS",
                    "value": "0"
                },
                {
                    "name": "MobileAppsManagement_EXTENSION_VERSION",
                    "value": "latest"
                },
                {
                    "name": "WEBSITE_LOAD_CERTIFICATES",
                    "value": "*"
                }
            ]
    

提交回复
热议问题