Skip to content

Commit

Permalink
Fixed deployment errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethcarnes committed Feb 18, 2024
1 parent b9d0234 commit f051395
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
23 changes: 22 additions & 1 deletion bicep/compute.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ param adminUsername string
param adminPublicKey string
param spokeVnetDetails array

resource networkInterfaces 'Microsoft.Network/networkInterfaces@2021-03-01' = [for (vnet, i) in spokeVnetDetails: {
name: '${vnet.name}-vm-nic'
location: location
properties: {
ipConfigurations: [
{
name: 'ipconfig1'
properties: {
subnet: {
id: resourceId('Microsoft.Network/virtualNetworks/subnets', vnet.name, 'Subnet1')
}
privateIPAllocationMethod: 'Dynamic'
}
}
]
}
}]

resource spokeVMs 'Microsoft.Compute/virtualMachines@2021-07-01' = [for (vnet, i) in spokeVnetDetails: {
name: '${vnet.name}-vm'
location: location
Expand Down Expand Up @@ -43,9 +61,12 @@ resource spokeVMs 'Microsoft.Compute/virtualMachines@2021-07-01' = [for (vnet, i
networkProfile: {
networkInterfaces: [
{
id: resourceId('Microsoft.Network/networkInterfaces', '${vnet.name}-vm-nic')
id: networkInterfaces[i].id
}
]
}
}
dependsOn: [
networkInterfaces
]
}]
6 changes: 3 additions & 3 deletions bicep/firewall.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ resource networkRuleCollection 'Microsoft.Network/firewallPolicies/ruleCollectio
name: 'Allow-DNS'
ruleType: 'NetworkRule'
sourceAddresses: [
'10.0.2.0/24'
'*'
]
destinationAddresses: [
'209.244.0.3'
'209.244.0.4'
'8.8.8.8'
'8.8.4.4'
]
ipProtocols: [
'TCP'
Expand Down

0 comments on commit f051395

Please sign in to comment.