Microsoft.Web staticSites/customDomains

Bicep resource definition

The staticSites/customDomains resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Web/staticSites/customDomains resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.Web/staticSites/customDomains@2025-03-01' = {
  parent: resourceSymbolicName
  kind: 'string'
  name: 'string'
  properties: {
    validationMethod: 'string'
  }
}

Property Values

Microsoft.Web/staticSites/customDomains

Name Description Value
kind Kind of resource. string
name The resource name string (required)
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
Symbolic name for resource of type: staticSites
properties StaticSiteCustomDomainRequestPropertiesARMResource resource specific properties StaticSiteCustomDomainRequestPropertiesARMResourcePropertiesOrStaticSiteCustomDomainOverviewARMResourceProperties

StaticSiteCustomDomainRequestPropertiesARMResourcePropertiesOrStaticSiteCustomDomainOverviewARMResourceProperties

Name Description Value
validationMethod Validation method for adding a custom domain string

Usage Examples

Bicep Samples

A basic example of deploying Static Web App Custom Domain.

param resourceName string = 'acctest0001'
param location string = 'westus'

resource staticSite 'Microsoft.Web/staticSites@2021-02-01' = {
  name: resourceName
  location: location
  properties: {}
  sku: {
    name: 'Free'
  }
}

resource customDomain 'Microsoft.Web/staticSites/customDomains@2021-02-01' = {
  parent: staticSite
  name: '${resourceName}.contoso.com'
  properties: {
    validationMethod: 'dns-txt-token'
  }
}

ARM template resource definition

The staticSites/customDomains resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Web/staticSites/customDomains resource, add the following JSON to your template.

{
  "type": "Microsoft.Web/staticSites/customDomains",
  "apiVersion": "2025-03-01",
  "name": "string",
  "kind": "string",
  "properties": {
    "validationMethod": "string"
  }
}

Property Values

Microsoft.Web/staticSites/customDomains

Name Description Value
apiVersion The api version '2025-03-01'
kind Kind of resource. string
name The resource name string (required)
properties StaticSiteCustomDomainRequestPropertiesARMResource resource specific properties StaticSiteCustomDomainRequestPropertiesARMResourcePropertiesOrStaticSiteCustomDomainOverviewARMResourceProperties
type The resource type 'Microsoft.Web/staticSites/customDomains'

StaticSiteCustomDomainRequestPropertiesARMResourcePropertiesOrStaticSiteCustomDomainOverviewARMResourceProperties

Name Description Value
validationMethod Validation method for adding a custom domain string

Usage Examples

Terraform (AzAPI provider) resource definition

The staticSites/customDomains resource type can be deployed with operations that target:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Web/staticSites/customDomains resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Web/staticSites/customDomains@2025-03-01"
  name = "string"
  parent_id = "string"
  body = {
    kind = "string"
    properties = {
      validationMethod = "string"
    }
  }
}

Property Values

Microsoft.Web/staticSites/customDomains

Name Description Value
kind Kind of resource. string
name The resource name string (required)
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: staticSites
properties StaticSiteCustomDomainRequestPropertiesARMResource resource specific properties StaticSiteCustomDomainRequestPropertiesARMResourcePropertiesOrStaticSiteCustomDomainOverviewARMResourceProperties
type The resource type "Microsoft.Web/staticSites/customDomains@2025-03-01"

StaticSiteCustomDomainRequestPropertiesARMResourcePropertiesOrStaticSiteCustomDomainOverviewARMResourceProperties

Name Description Value
validationMethod Validation method for adding a custom domain string

Usage Examples

Terraform Samples

A basic example of deploying Static Web App Custom Domain.

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westus"
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "staticSite" {
  type      = "Microsoft.Web/staticSites@2021-02-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {}
    sku = {
      name = "Free"
    }
  }
}

resource "azapi_resource" "customDomain" {
  type      = "Microsoft.Web/staticSites/customDomains@2021-02-01"
  parent_id = azapi_resource.staticSite.id
  name      = "${var.resource_name}.contoso.com"
  body = {
    properties = {
      validationMethod = "dns-txt-token"
    }
  }
}