forked from p-prakash/serverless-url-shortener-azure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dns-records.bicep
41 lines (36 loc) · 831 Bytes
/
dns-records.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
37
38
39
40
41
@description('DNS Zone for shortening domain')
param dnsZone string
@description('DNS Zone validation Token')
param validationToken string
@description('Front Door Endpoint Id')
param cdnEndpointId string
// Obtain existing DNS Zone
resource existingDnsZone 'Microsoft.Network/dnszones@2018-05-01' existing = {
name: dnsZone
}
// Create Validation Text Record
resource validationTextRecord 'Microsoft.Network/dnszones/TXT@2018-05-01' = {
name: '_dnsauth'
parent: existingDnsZone
properties: {
TTL: 300
TXTRecords: [
{
value: [
validationToken
]
}
]
}
}
// Create DNS A Record
resource dnsARecord 'Microsoft.Network/dnszones/A@2018-05-01' = {
name: '@'
parent: existingDnsZone
properties: {
targetResource: {
id: cdnEndpointId
}
TTL: 60
}
}