5

I need to create an Azure VM image that can be used by other people to create VMs in their own subscriptions.

I've looked at the Azure documentation for VMs and images. I can find info on how to create images and about how to create VMs from an image. But I cannot find any reliable information on whether there's any way to make my VM available to other people with their own subscriptions. The official Microsoft Azure documentation doesn't ever say whether or not this can be done. Some unofficial sources seem to say that I need to put the image in a Container and make the Container public, and people can copy it to their own subscription.

Can anyone tell me whether my goal in the first paragraph is possible, and if so how do I do it?

3

The link Michael provided is the official process of sharing Images within your company (same AD Tenant) across subscription and region.

https://docs.microsoft.com/en-us/azure/virtual-machines/windows/shared-image-galleries

One key thing to point out it's still in preview which means it limited and you will need to manually register the feature.

Hope this help.....

0

google is your friend!!

besides the new gallery feature mentioned in the comments, you can do it manually, the "old" way.

Create an managed image in the source subscription

Create a managed snapshot of the OS disk from the generalized VM

Copy the managed snapshot to the target Azure subscription

In the target subscription, create an managed image from the copied snapshot

all steps described comprehensively includes code snippets:

https://michaelcollier.wordpress.com/2017/05/03/copy-managed-images/

0

According to the shared image gallery docs linked by Hannel:

Q. How can I list all the Shared Image Gallery resources across subscriptions?

A. In order to list all the Shared Image Gallery resources across subscriptions that you have access to on the Azure portal, follow the steps below:

Open the Azure portal. Go to All Resources. Select all the subscriptions under which you’d like to list all the resources. Look for resources of type Private gallery.

To see the image definitions and image versions, you should also select Show hidden types.

To list all the Shared Image Gallery resources across subscriptions that you have permissions to, use the following command in the Azure CLI:

az account list -otsv --query "[].id" | xargs -n 1 az sig list --subscription

Q. How do I share my images across subscriptions?

A. You can share images across subscriptions using Role Based Access Control (RBAC). Any user that has read permissions to an image version, even across subscriptions, will be able to deploy a Virtual Machine using the image version.

Q. Can I move my existing image to the shared image gallery?

A. Yes. There are 3 scenarios based on the types of images you may have.

Scenario 1: If you have a managed image, then you can create an image definition and image version from it.

Scenario 2: If you have an unmanaged generalized image, you can create a managed image from it, and then create an image definition and image version from it.

Scenario 3: If you have a VHD in your local file system, then you need to upload the VHD, create a managed image, then you can create and image definition and image version from it.

If the VHD is of a Windows VM, see Upload a generalized VHD. If the VHD is for a Linux VM, see Upload a VHD

...

Q. Can I create a shared image gallery, image definition, and image version through the Azure portal?

A. No, currently we do not support the creation of any of the Shared Image Gallery resources through Azure portal. However, we do support the creation of the Shared Image Gallery resources through CLI, Templates, and SDKs. PowerShell will also be released soon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.