如何设置“仅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).