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.
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 ofcname-delegation
ordns-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 withdns-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.
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.
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.
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 - stringkind
optional - stringKind of resource.
name
required - stringThe custom domain to create.
properties
requiredvalidationMethod
optional - stringValidation method for adding a custom domain
type
required - string