Skip to content

Instantly share code, notes, and snippets.

@johnlokerse
Created September 11, 2023 18:02
Show Gist options
  • Save johnlokerse/05bf029f5c419bd1e80c09142f4ca1e3 to your computer and use it in GitHub Desktop.
Save johnlokerse/05bf029f5c419bd1e80c09142f4ca1e3 to your computer and use it in GitHub Desktop.
Azure Bicep Tips and Tricks Blog
param name string
param location string = resourceGroup().location
param addressPrefixes array
param subnets array
var dnsServers = [
'1.2.3.4'
]
resource virtualNetwork 'Microsoft.Network/virtualNetworks@2019-11-01' = {
name: name
location: location
properties: {
dhcpOptions: {
dnsServers: dnsServers
}
addressSpace: {
addressPrefixes: addressPrefixes
}
subnets: [for subnet in subnets: {
name: subnet.name
properties: {
addressPrefix: subnet.addressPrefix
}
}]
}
}
output virtualNetworkId string = virtualNetwork.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment