I have created an environment on scale set first instance, now I want to capture an image of that scale set instance (Protected from scale-in) so that I can create another scale set with that image with environment. Any way to capture or backup that instance of scale set in azure?
Asked
Active
Viewed 656 times
1
-
Any updates on this question? Does it solve your problem? If yes, please accept it – Charles Xu Jan 01 '21 at 06:15
1 Answers
3
You can use the Azure CLI command az image create
to capture the image from the scale set like this:
az image create -g group_name -n image_name --source instance_os_disk_resourceId --os-type xxxx
And you can use the command az vmss list-instances
to get the OS disk resource ID of the instance. For example:
az vmss list-instances -g charlesVMSS -n azurevmss -o table --query "[].[instanceId, storageProfile.osDisk.managedDisk.id]"

Charles Xu
- 29,862
- 2
- 22
- 39