-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.bicep
42 lines (38 loc) · 1.11 KB
/
main.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
42
param privateDnsZoneName string = 'contoso.com'
param autoVmRegistration bool = true
param vnetName string = 'Vnet1'
param vnetAddressPrefix string = '10.0.0.0/16'
param subnetName string = 'Subnet1'
param subnetAddressPrefix string = '10.0.1.0/24'
param location string = resourceGroup().location
resource virtualNetwork 'Microsoft.Network/virtualNetworks@2020-06-01' = {
name: vnetName
location: location
properties: {
addressSpace: {
addressPrefixes: [
vnetAddressPrefix
]
}
}
}
resource subnet 'Microsoft.Network/virtualNetworks/subnets@2020-06-01' = {
name: '${virtualNetwork.name}/${subnetName}'
properties: {
addressPrefix: subnetAddressPrefix
}
}
resource privateDnsZone 'Microsoft.Network/privateDnsZones@2018-09-01' = {
name: privateDnsZoneName
location: 'global'
}
resource virtualNetworkLink 'Microsoft.Network/privateDnsZones/virtualNetworkLinks@2018-09-01' = {
name: '${privateDnsZone.name}/${privateDnsZone.name}-link'
location: 'global'
properties: {
registrationEnabled: autoVmRegistration
virtualNetwork: {
id: virtualNetwork.id
}
}
}