Other Articles

App Service – Redirect HTTP to HTTPS

This check ensures that Azure Web Applications automatically redirect all HTTP traffic to HTTPS to enforce encrypted communication.

Check Details

  • Resource: Azure App Service (Web App)
  • Check: Redirect HTTP to HTTPS
  • Risk: Allowing HTTP traffic may expose sensitive data to interception, man-in-the-middle attacks, and credential compromise due to unencrypted communication.

Remediation via Azure Portal

  1. Log in to the Azure Portal. Azure Portal dashboard
  2. Navigate to App Services and select the affected Web App. Azure App Services list
  3. In the left-hand menu, select Configuration. Web App configuration menu
  4. Under the General settings tab, locate HTTPS Only.
  5. Set HTTPS Only to On. HTTPS Only setting in Azure Web App
  6. Click Save to apply the configuration.

Remediation via Azure CLI

  1. Open Azure Cloud Shell or a local terminal with Azure CLI installed. Azure Cloud Shell
  2. Enable HTTPS Only:

    az webapp update \
     --resource-group <resource-group> \
     --name <web-app-name> \
     --https-only true
    
  3. Verify HTTPS Only is enabled:

    az webapp show \
     --resource-group <resource-group> \
     --name <web-app-name> \
     --query httpsOnly
    

Replace <resource-group> and <web-app-name> with your actual values.