From f50cfc00479ef1e99e55d6ba3a104eef72956e09 Mon Sep 17 00:00:00 2001 From: Federico Arambarri Date: Mon, 16 Sep 2024 08:53:55 -0300 Subject: [PATCH] Adjustments --- .../azuredeploy.bicep | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/solutions/azure-automation-state-configuration/azuredeploy.bicep b/solutions/azure-automation-state-configuration/azuredeploy.bicep index 93d6259..ccd4372 100644 --- a/solutions/azure-automation-state-configuration/azuredeploy.bicep +++ b/solutions/azure-automation-state-configuration/azuredeploy.bicep @@ -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) } ] } @@ -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' @@ -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) } ] } @@ -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