You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过ARM模板为Azure Web App配置Https Only

Enable HTTPS Only via ARM Template for Azure Web Apps

To configure the HTTPS Only setting for your Azure Web App in an ARM template, you need to add the httpsOnly property within the properties section of your Microsoft.Web/sites resource definition.

Step-by-Step Configuration

  1. Locate the Microsoft.Web/sites resource block in your existing ARM template.
  2. Within the properties object of this resource, add or update the httpsOnly attribute to true.

Example Resource Snippet

Here's how the relevant part of your template should look:

{
  "type": "Microsoft.Web/sites",
  "apiVersion": "2022-09-01",
  "name": "[parameters('webAppName')]",
  "location": "[parameters('location')]",
  "properties": {
    "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('appServicePlanName'))]",
    "httpsOnly": true, // This line enables the HTTPS Only enforcement
    // Keep your existing properties here...
  },
  "dependsOn": [
    "[resourceId('Microsoft.Web/serverfarms', parameters('appServicePlanName'))]"
  ]
}

Quick Notes

  • If the httpsOnly property already exists in your template, just toggle its value to true instead of adding a new line.
  • This setting will automatically redirect all HTTP requests to HTTPS, identical to the manual toggle you set in the Azure portal.

内容的提问来源于stack exchange,提问作者James Comstock

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 03:43:22