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

查看:18
本文介绍了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.

在 Azure 资源模板 json 文件中,有一些示例可以直接从 JSON 模板文件创建连接字符串,该文件具有config"类型的子依赖项和connectionStrings"属性,如此处的最后一个示例 http://haishibai.blogspot.co.uk/2014/09/tutorial-building-azure-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 模板文件为资源管理器部署定义网站应用设置?如果是这样,任何链接或细节将不胜感激.

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)

推荐答案

我有一个示例说明如何执行此操作 这里.它看起来像这样:

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-01 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天全站免登陆