Skip to content

azure-appsvc-auth-enabled

It is recommended to enable App Service Authentication in order to ensure that your authentication and identity validation is securely managed at the edge.

Examples

Insecure Example

resource "azurerm_app_service" "example" {
  name                = "example-app-service"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  app_service_plan_id = azurerm_app_service_plan.example.id
}

Secure Example

resource "azurerm_app_service" "example" {
  name                = "example-app-service"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  app_service_plan_id = azurerm_app_service_plan.example.id

  auth_settings {
    enabled = true
    default_provider = "AzureActiveDirectory"
    issuer = "https://sts.windows.net/xxxxxxx-xxxx-xxx-xxxx-xxxtenantID/"
    unauthenticated_client_action = "RedirectToLoginPage"
  }
}

More information