HOW TO CREATE AN AZURE COMPUTE GALLERY, CAPTURE THE IMAGE OF A VM AND STORE IT IN A COMPUTE GALLERY.
Published: 2023-05-11 11:27:28


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/snnyd9mbnp2z3bqua0xi.png)

**An Azure Compute Gallery** (formerly known as Shared Image Gallery) simplifies sharing resources, like images and application packages, across your organization. The Azure Compute Gallery lets you share custom VM images and application packages with others in your organization, within or across regions, within a tenant.(microsoft.com)

**An Azure VM image** is a pre-configured virtual machine (VM) that is used as a template to create new VM instances. An Azure VM image contains the operating system, applications, and other configurations that are necessary to run the VM.

**The Azure VM image** is created by capturing the virtual hard disk (VHD) of a configured VM, and it can be used to create multiple VM instances with the same configuration. This is particularly useful for deploying and scaling applications, as it allows you to quickly and easily provision new VM instances with the same settings and configurations as the original VM image.

Step 1:
This is a very interesting walkthrough because you have to create a Windows VM with RDP and Data Disk first before you can capture the image to be used in the compute gallery. If you don't know how to create one, kindly visit my article (https://dev.to/toluwani_oluwaloseyi/how-to-deploy-a-windows-vm-rdp-into-it-and-add-a-data-disc-to-the-windows-vm-on-a-macbook-4163) to learn how to.

Step 2:
Go to the VM that you already created and make sure its running.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/psw8ynh2yosb6fz3qe9s.png)

Step 3:
Open azure portal on a new tab, search for azure compute galleries and click on "create"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2uxb87voy9ht2svcndu7.png)

Step 4:
1. Subscription: Choose the subscription where you wish to create the resource.
2. Resource group: Choose the resource group where you wish to create the resource. If you wish to create a new group click on create a new option.
3. Name: Enter a preferred unique name.
4. Region: Select the location where you wish to create the account.

Click on "review+create"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mhn0cr0als2lc21heabp.png)

Step 5:
After validation is passed, Click on "create"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pt67kqkl2psmuglnn5v3.png)

Step 6:
Go back to the VM you created, click on "overview",then click on "capture"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qcnjf5qnloxnswv1qxqe.png)

Step 7:
1. Subscription: Choose the subscription where you wish to create the resource.
2. Resource group: Choose the resource group where you wish to create the resource. If you wish to create a new group click on create a new option.
3. Region: Select the location where you wish to create the account.
4. Target azure compute gallery: choose the gallery you just created from the dropdowns (I chose tolugallery)
5. Target VM Image: Create new random name
6. Version number: 0.0.1
7. Default replica count: 2 (this means you have your image backups in different places/regions)
8. Target regions: Add 2 more regions

Click on review+create"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fnzf4sh3215grabqx5e6.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjj3wvzz01y1a2ixfn6r.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a1nu330lu7uv6upayoh0.png)

Step 8:
Once validation is passed, click on "create"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q7agbo579uaobhh2mabu.png)

Step 9:
After deployment is completed, go back to the compute gallery to see if the image has been captured and is in the gallery.
 _(Please note that the deployment of the CaptureVM will be a little delayed because it has to stop and make the virtual machine generalized so that it does not conform to one particular standard and then make it flexible so admin and user password can be added)_

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/azdwmgco7bqyvx6vv7dj.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r5yodwhb59dcsbf63kat.png)

Thank you for reading...