Skip to content

Commit

Permalink
Adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Arambarri committed Sep 16, 2024
1 parent f9a0a6f commit f50cfc0
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions solutions/azure-automation-state-configuration/azuredeploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ resource windowsVM 'Microsoft.Compute/virtualMachines@2023-09-01' = [
networkProfile: {
networkInterfaces: [
{
id: resourceId('Microsoft.Network/networkInterfaces', '${windowsNicName}${i}')
id: resourceId('Microsoft.Network/networkInterfaces', windowsNic[i].name)
}
]
}
Expand All @@ -366,16 +366,14 @@ resource windowsVM 'Microsoft.Compute/virtualMachines@2023-09-01' = [
encryptionAtHost: true
}
}
dependsOn: [
windowsNic
]
}
]

// https://learn.microsoft.com/azure/virtual-machines/extensions/guest-configuration#bicep-template
resource guestConfigExtensionWindows 'Microsoft.Compute/virtualMachines/extensions@2021-03-01' = [
for i in range(0, windowsVMCount): {
parent: windowsVM[i]
name: 'Microsoft.GuestConfiguration${windowsVM[i].name}'
name: 'AzurePolicyforWindows${windowsVM[i].name}'
location: location
properties: {
publisher: 'Microsoft.GuestConfiguration'
Expand Down Expand Up @@ -556,7 +554,7 @@ resource linuxVMN 'Microsoft.Compute/virtualMachines@2023-09-01' = [
networkProfile: {
networkInterfaces: [
{
id: resourceId('Microsoft.Network/networkInterfaces', '${linuxNicName}${i}')
id: resourceId('Microsoft.Network/networkInterfaces', linuxNic[i].name)
}
]
}
Expand All @@ -565,20 +563,18 @@ resource linuxVMN 'Microsoft.Compute/virtualMachines@2023-09-01' = [
encryptionAtHost: true
}
}
dependsOn: [
linuxNic
]
}
]

// https://learn.microsoft.com/azure/virtual-machines/extensions/guest-configuration#bicep-template
resource guestConfigExtensionLinux 'Microsoft.Compute/virtualMachines/extensions@2021-03-01' = [
for i in range(0, linuxVMCount): {
parent: linuxVMN[i]
name: 'Microsoft.GuestConfiguration${linuxVMN[i].name}'
name: 'Microsoft.AzurePolicyforLinux${linuxVMN[i].name}'
location: location
properties: {
publisher: 'Microsoft.GuestConfiguration'
type: 'ConfigurationforLinux'
type: 'ConfigurationForLinux'
typeHandlerVersion: '1.0'
autoUpgradeMinorVersion: true
enableAutomaticUpgrade: true
Expand Down

0 comments on commit f50cfc0

Please sign in to comment.