Skip to content

equinor/terraform-azurerm-web-app

Repository files navigation

Azure Web App Terraform module

SCM Compliance Equinor Terraform Baseline Conventional Commits

Terraform module which creates an Azure Web App.

Features

  • HTTPS enforced.
  • Public network access denied by default.
  • Managed certificates automatically created for custom hostnames.
  • Application logging enabled (automatically disabled after 12 hours, see notes).
  • Audit logs sent to given Log Analytics workspace by default.
  • Changes to app settings BUILD, BUILD_NUMBER and BUILD_ID ignored, allowing them to be configured outside of Terraform (commonly in a CI/CD pipeline).

Notes

Application logging

Application logging is enabled by default, however it'll be automatically disabled after 12 hours. It can be re-enabled at any time by running the following Azure CLI command:

az webapp log config -n <APP_NAME> -g <RESOURCE_GROUP_NAME> --application-logging filesystem

Development

  1. Read this document.

  2. Clone this repository.

  3. Configure Terraform variables in a file .devcontainer/devcontainer.env:

    TF_VAR_resource_group_name=
    TF_VAR_location=
  4. Open repository in dev container.

Testing

  1. Change to the test directory:

    cd test
  2. Login to Azure:

    az login
  3. Set active subscription:

    az account set -s <SUBSCRIPTION_NAME_OR_ID>
  4. Run tests:

    go test -timeout 60m

Contributing

See Contributing guidelines.