Azure App Service (Web Apps) Custom Domain

This page shows how to write Terraform and Azure Resource Manager for App Service (Web Apps) Custom Domain and write them securely.

azurerm_static_site_custom_domain (Terraform)

The Custom Domain in App Service (Web Apps) can be configured in Terraform with the resource name azurerm_static_site_custom_domain. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

The following arguments are supported:

  • domain_name - (Required) The Domain Name which should be associated with this Static Site. Changing this forces a new Static Site Custom Domain to be created.

  • static_site_id - (Required) The ID of the Static Site. Changing this forces a new Static Site Custom Domain to be created.

  • validation_type - (Required) One of cname-delegation or dns-txt-token. Changing this forces a new Static Site Custom Domain to be created.

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the Static Site Custom Domain.

  • validation_token - Token to be used with dns-txt-token validation.

Explanation in Terraform Registry

Manages a Static Site Custom Domain. !> DNS validation polling is only done for CNAME records, terraform will not validate TXT validation records are complete.

Tips: Best Practices for The Other Azure App Service (Web Apps) Resources

In addition to the azurerm_app_service, Azure App Service (Web Apps) has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.

risk-label

azurerm_app_service

Ensure your App Service is accessible via HTTPS only

It is better to configure the App Service to be accessible via HTTPS only. By default, both HTTP and HTTPS are available.

risk-label

azurerm_function_app

Ensure to enable authentication to prevent anonymous request being accepted

It is better to enable authentication to prevent anonymous requests and ensure all communications in the application are authenticated.

Review your Azure App Service (Web Apps) settings

In addition to the above, there are other security points you should be aware of making sure that your .tf files are protected in Shisho Cloud.

Microsoft.Web/staticSites/customDomains (Azure Resource Manager)

The staticSites/customDomains in Microsoft.Web can be configured in Azure Resource Manager with the resource name Microsoft.Web/staticSites/customDomains. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

  • apiVersion required - string
  • kind optional - string

    Kind of resource.

  • name required - string

    The custom domain to create.

  • properties required
      • validationMethod optional - string

        Validation method for adding a custom domain

  • type required - string

Frequently asked questions

What is Azure App Service (Web Apps) Custom Domain?

Azure App Service (Web Apps) Custom Domain is a resource for App Service (Web Apps) of Microsoft Azure. Settings can be wrote in Terraform.