如何设置“仅HTTPS"使用ARM模板的Azure Web应用程序安装? [英] How can I set "Https only" for my Azure web app using an ARM template?

查看:47
本文介绍了如何设置“仅HTTPS"使用ARM模板的Azure Web应用程序安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何在Azure门户中手动设置仅HTTPs .在Azure门户中导航到我的Web应用程序>自定义域,将打开自定义域"窗格,该窗格具有仅HTTPs"选项.将此选项设置为开"将启用我正在寻找的功能.我在

I know how to set Https only manually in the Azure portal. Navigating to My Web Application > Custom domains in the Azure portal opens the Custom domains pane, which has an "Https Only" option. Setting this option to "On" enables the functionality I am looking for. I found how to do this manually on Benjamin Perkins Blog. Unfortunately, it does not contain a description of how to solve the problem in an automated way using ARM templates.

如何在我的ARM模板中设置此仅HTTPs"标志,以便可以在部署中自动执行此设置?假设我已经有一个可以正常工作的ARM部署,并且只需要知道专门为此设置添加到模板的位置和内容.

How can I set this "Https only" flag in my ARM template so that I can automate this setting in my deployment? Assume I have a working ARM deployment already, and just need to know where and what to add to the template specifically for this setting.

我想保留基于ARM模板的方法的答案.

I would like to keep answers to an ARM template based approach.

感谢您的时间!

推荐答案

是的,有可能.您可以检查此链接. httpsOnly 是属性中的值.例如:

Yes, it is possible. You could check this link. httpsOnly is a value in properties. For example:

{
    "apiVersion": "2015-08-01",
    "name": "[parameters('webSiteName')]",
    "type": "Microsoft.Web/sites",
    "location": "[resourceGroup().location]",
    "tags": {
        "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource",
        "displayName": "Website"
    },
    "dependsOn": [
        "[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
    ],
    "properties": {
        "name": "[parameters('webSiteName')]",
        "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('hostingPlanName'))]",
        "httpsOnly": true
    }
}

ps.模板引用可能包含错误,请使用api引用(虽然不完美,但更好).

ps. Template reference might contain error, use api reference (its not perfect, but its better).

这篇关于如何设置“仅HTTPS"使用ARM模板的Azure Web应用程序安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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