0

I am running sysprep artifact on my VM through my code -

az lab vm apply-artifacts ...

It is showing up as succeeded when I check it from the portal. When I check more details about the artifact, it doesn't show me any error. The only extension message I see is:

/generalize /oobe /shutdown

Yet it is not deallocated. When I run sysprep again on the same VM from the portal, it works fine - the VM stops and gets deallocated.

Not sure what is happening or how to debug?

Pranav Raj
  • 781
  • 1
  • 8
  • 19

1 Answers1

0

When a VM shuts down on its own, it is not deallocated - this is the expected behavior. The Stop button in the Azure portal shuts down the VM and deallocates it. If using PowerShell Stop-AzureRmVM, you can pass in the -StayProvisioned parameter to control this.

Steven Berkovitz
  • 781
  • 4
  • 13