Azure resource manager template website app settings

后端 未结 4 1288
慢半拍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 16:44

    Here is the solution for the latest release 2014-06-01 version of API.

    "resources": [
        {
            "apiVersion": "2014-06-01",
            "name": "[parameters('webSiteName')]",
            "type": "Microsoft.Web/sites",
            "location": "[parameters('webSiteLocation')]",
            "tags": {
                "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('webSiteHostingPlanName'))]": "Resource",
                "displayName": "WebSite"
            },
            "dependsOn": [
                "[concat('Microsoft.Web/serverfarms/', parameters('webSiteHostingPlanName'))]"
            ],
            "properties": {
                "name": "[parameters('webSiteName')]",
                "serverFarm": "[parameters('webSiteHostingPlanName')]"
            },
            "resources": [
                {
                    "apiVersion": "2014-04-01",
                    "name": "MSDeploy",
                    "type": "extensions",
                    "dependsOn": [
                        "[concat('Microsoft.Web/Sites/', parameters('webSiteName'))]"
                    ],
                    "properties": {
                        "packageUri": "[concat(parameters('dropLocation'), '/', parameters('webSitePackage'), parameters('dropLocationSasToken'))]",
                        "dbType": "None",
                        "connectionString": "",
                        "setParameters": {
                            "IIS Web Application Name": "[parameters('webSiteName')]"
                        }
                    }
                },
                {
                    "apiVersion": "2014-04-01",
                    "name": "web",
                    "type": "config",
                    "dependsOn": [
                        "[resourceId('Microsoft.Web/Sites', parameters('webSiteName'))]"
                    ],
                    "properties": {
                        "connectionStrings": [
                            {
                                "ConnectionString": "AzureWebJobsStorage",
                                "Name": "CustomConnectionString1"
                            },
                            {
                                "ConnectionString": "AzureWebJobsStorage",
                                "Name": "CustomConnectionString2"
                            }
                        ],
                        "appSettings": [
                            {
                                "Name": "Key1",
                                "Value": "Value1"
                            },
                            {
                                "Name": "Key2",
                                "Value": "Value2"
                            }
                        ]
                    }
                }
            ]
        },
    

提交回复
热议问题