I have a bicep to deploy a static web app:
@description('rootCustomDomainName')
param rootCustomDomainName string = 'https://xyz.contoso.com'
resource staticWebApp 'Microsoft.Web/staticSites@2022-03-01' = {
name: 'my-ui'
location: location
sku: {
name: 'Free'
tier: 'Free'
}
properties: {
allowConfigFileUpdates: true
branch: branch
buildProperties: {
appLocation: 'UI/web-app'
skipGithubActionWorkflowGeneration: true
}
enterpriseGradeCdnStatus: 'Disabled'
provider: 'DevOps'
repositoryUrl: repositoryUrl
stagingEnvironmentPolicy: 'Disabled'
}
}
resource rootCustomDomain 'Microsoft.Web/staticSites/customDomains@2022-03-01' = {
parent: staticWebApp
name: rootCustomDomainName
properties: {}
}
On deploying this, I see the following error:
[error]Deployment template validation failed: 'The template resource
my-ui/https://xyz.contoso.com
for type 'Microsoft.Web/staticSites/customDomains' at line '1' and column '2294' has incorrect segment lengths. A nested resource type must have identical number of segments as its resource name. A root resource type must have segment length one greater than its resource name.
What am I missing? How do I fix this?