Azure的资源管理模板网站应用程序设置 [英] Azure resource manager template website app settings

查看:144
本文介绍了Azure的资源管理模板网站应用程序设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过JSON模板文件的应用程序设置添加到我的Azure网站,在Azure资源管理器的一部分。

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

在一个蓝色的资源模板JSON文件,也有直接从类型'配置'的与'是connectionStrings在这里的最后一个例子的 http://haishibai.blogspot.co.uk/2014/09/tutorial-建筑天青template.html 我还检查了网站架构定义的网站在这里的http://schema.management.azure.com/schemas/2014-06-01/Microsoft.Web.json#/definitions/sites并不能看出它是可能的。

In an Azure Resource template json file, there are examples for creating connectionStrings directly from the JSON template file with a sub-dependency of type 'config' with properties for 'connectionStrings' as in the final example here http://haishibai.blogspot.co.uk/2014/09/tutorial-building-azure-template.html I have also checked in the website schema definition for websites here http://schema.management.azure.com/schemas/2014-06-01/Microsoft.Web.json#/definitions/sites and cannot see that it is possible.

是否有可能从JSON模板文件定义了资源管理器部署的网站应用程序的设置?如果是的话任何链接或细节将大大AP preciated。

Is it possible to define a websites app settings for resource manager deployments from the JSON template file? And if so any links or details would be greatly appreciated.

(我已经尝试过的appSettings的性能配置内部资源和网站资源中)

(I have already tried properties of appSettings inside the config resource and inside the website resource)

推荐答案

我有一个示例,演示如何做到这一点<一个href=\"https://github.com/davidebbo/AzureWebsitesSamples/blob/3ab2e9ff14c66719271a62c1ba8213c5258c7a6e/ARMTemplates/WebSiteManyFeatures.json#L96-L108\">here.它看起来是这样的:

I have a sample that shows how to do this here. It looks like this:

    {
      "apiVersion": "2014-11-01",
      "name": "appsettings",
      "type": "config",
      "dependsOn": [
        "[resourceId('Microsoft.Web/Sites', parameters('siteName'))]"
      ],
      "properties": {
        "AppSettingKey1": "Some value",
        "AppSettingKey2": "My second setting",
        "AppSettingKey3": "My third setting"
      }
    }

请确保您使用最新的2014年11月1日的API,因为它与应用程序设置交易的方式是从旧的API有点不同。

Please make sure you use the newest 2014-11-01 API, as the way it deals with app settings is a bit different from the older API.

这篇关于Azure的资源管理模板网站应用程序设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆