2

I've built a VM in Azure using Powershell commands and an ARM template. My template has this section:

             "osProfile": {
                    "computerName": "[parameters('virtualMachines_abc_name')]",
                    "adminUsername": "testadm",
                    "windowsConfiguration": {
                        "provisionVMAgent": true,
                        "enableAutomaticUpdates": true
                    },
                    "secrets": [],
                    "allowExtensionOperations": true
                },

You can see I've set "enableAutomaticUpates" to true. BUT when the machine is provisioned, it's not enabled. Anyone seen this issue before? Is there an equivalent Powershell command I can run on a specific VM? My VM is Windows Datacentre OS.

Thanks for any pointers in advance!

1
  • You can try the custom vm extension with a PowerShell script in the template. Commented Nov 2, 2018 at 1:54

2 Answers 2

1

I have always created VM with that option and never had any issues. Do you have something that indicates Windows update was not enabled after using that option?

But as far as Powershell equivalent;

Set-AzureRmVMOperatingSystem -VM $vm -Windows -ComputerName $computerName -Credential $cred -ProvisionVMAgent -EnableAutoUpdate

https://learn.microsoft.com/en-us/powershell/module/azurerm.compute/set-azurermvmoperatingsystem?view=azurermps-6.11.0

Sign up to request clarification or add additional context in comments.

Comments

1

This looks syntactically correct: https://learn.microsoft.com/en-us/azure/templates/Microsoft.Compute/virtualMachines?toc=%2Fen-us%2Fazure%2Fazure-resource-manager%2Ftoc.json&bc=%2Fen-us%2Fazure%2Fbread%2Ftoc.json

I've never seen this being used though, only various solutions, like Azure Automation\Log Analytics

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.