// Reside in different RS
resource dnsZone 'Microsoft.Network/dnsZones@2018-05-01' existing = {
name: 'example.com'
}
// creating web resources into different one.
resource sites_TestSpa_name 'Microsoft.Web/sites@2020-12-01' = {
name: sites_TestSpa_name_var
location: resourceGroup().location
kind: 'app'
properties: {
serverFarmId: serverFarmID
siteConfig: {
http20Enabled: true
nodeVersion: '~14'
requestTracingEnabled: true
requestTracingExpirationTime: '12/31/9999 11:59:00 PM'
httpLoggingEnabled: true
detailedErrorLoggingEnabled: true
publishingUsername: '$TestSpa-${environment}'
appSettings: [
{
name: 'WEBSITE_HTTPLOGGING_RETENTION_DAYS'
value: '3'
}
{
name: 'WEBSITE_NODE_DEFAULT_VERSION'
value: '~14'
}
{
name: 'WEBSITE_RUN_FROM_PACKAGE'
value: '1'
}
]
scmType: 'VSTSRM'
alwaysOn: false
virtualApplications: [
{
virtualPath: '/'
physicalPath: 'site\\wwwroot'
preloadEnabled: false
}
]
cors: {
allowedOrigins: [
]
supportCredentials: true
}
}
httpsOnly: true
}
}
resource sites_TestSpa_name_sites_TestSpa_name_azurewebsites_net 'Microsoft.Web/sites/hostNameBindings@2020-12-01' = {
parent: sites_TestSpa_name
name: '${toLower('${sites_TestSpa_name_var}.azurewebsites.net')}'
properties: {
siteName: sites_TestSpa_name_var
hostNameType: 'Verified'
}
}
resource sites_TestSpa_name_environment_testspa_biberk_com 'Microsoft.Web/sites/hostNameBindings@2020-12-01' = {
parent: sites_TestSpa_name
name: '${toLower('${environment}-testspa.example.com')}'
properties: {
siteName: sites_TestSpa_name_var
hostNameType: 'Verified'
sslState: 'SniEnabled'
thumbprint: certificateName_resource.properties.thumbprint
}
dependsOn: [
sites_TestSpa_name_sites_TestSpa_name_azurewebsites_net
]
}
// adding cname
resource dnsRecord 'Microsoft.Network/dnsZones/CNAME@2018-05-01' = {
parent: dnsZone
name: 'dev-testspa'
properties: {
TTL: 300
CNAMERecord: {
cname: 'TestSpa-dev.azurewebsites.net'
}
}
}
deployment error:
"status": "Failed",
"error": {
"code": "ParentResourceNotFound",
"message": "Can not perform requested operation on nested resource. Parent resource 'example.com' not found."
}