-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathswa.bicep
36 lines (30 loc) · 887 Bytes
/
swa.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
param name string
param location string = resourceGroup().location
param tags object = {}
param domainName string = ''
param sku object = {
name: 'Free'
tier: 'Free'
}
resource web 'Microsoft.Web/staticSites@2022-03-01' = {
name: name
location: location
tags: tags
sku: sku
properties: {
provider: 'Custom'
}
}
// Necessary due to https://github.com/Azure/bicep/issues/9594
// placeholderName is never deployed, it is merely used to make the child name validation pass
var domainNameForBicep = !empty(domainName) ? domainName : 'placeholderName'
resource swaDomain 'Microsoft.Web/staticSites/customDomains@2022-03-01' = if (!empty(domainName)) {
name: domainNameForBicep
kind: 'string'
parent: web
properties: {
validationMethod: 'cname-delegation'
}
}
output name string = web.name
output uri string = 'https://${web.properties.defaultHostname}'