question

EbenKrapfl-2689 avatar image
0 Votes"
EbenKrapfl-2689 asked kobulloc-MSFT answered

Azure DevTest Labs Create VMs under multiple subscriptions

I am curious if there is any way to setup Azure DevTest Labs to utilize different Azure subscriptions when creating VMs.

The use case I am asking for is for a small company where all of the developers have Visual Studio Enterprise subscriptions with monthly Azure credits allotted to them. We would like to setup DevTest Labs with some sort of "quick VMs" for devs to be able to spin up and use for day to day development and building. This seems like it is one of the purposes of DevTest Labs, as I understand it. But what I would like is to be able setup the DevTest Lab with all of the shared machine setup and things, and then have devs create the VMs using their own subscriptions (and their own Azure credits). Is that possible? It seems like DevTest Labs doesn't allow you a way to choose a subscription (or even a resource group, for that matter) at VM creation time. Am I missing something?

Thanks,
Eben

azure-devtestlabs
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello, @EbenKrapfl-2689!

I'm still doing some research on this but there are a couple things that come to mind:

Resource Groups
The default behavior for DevTest Labs is to create a new resource group whenever a new virtual machine is created but the lab owner can configure VMs to be created in a specific resource group. While it sounds like you may be looking for multiple custom resource groups I thought I'd mention it just in case.

https://docs.microsoft.com/en-us/azure/devtest-labs/resource-group-control

![200358-image.png][1]

Multiple subscriptions using Shared Image Galleries
You can take advantage of Shared Image Galleries to create a base that is available for creation in DevTest Labs set up across multiple subscriptions. In this scenario you would create a base image and version that would be used when creating the lab:

https://docs.microsoft.com/en-us/azure/devtest-labs/add-vm-use-shared-image

![200472-image.png][2]

![200473-image.png][3]
[1]: /answers/storage/attachments/200358-image.png
[2]: /answers/storage/attachments/200472-image.png
[3]: /answers/storage/attachments/200473-image.png

1 Vote 1 ·
image.png (197.8 KiB)
image.png (58.1 KiB)
image.png (40.3 KiB)

Hello, @EbenKrapfl-2689!

(In response to an earlier reply) No worries! I kind of figured that the single, dedicated resource group wasn't what you were looking for but I thought I'd mention it all the same just in case.

I agree that the Shared Image Gallery approach takes away a layer of what makes DevTest Labs easy and convenient but once it's set up, image versioning may still end up being pretty useful. I have some more research to do and I'll let you know if I come up with anything better.

1 Vote 1 ·

Hi @kobulloc-MSFT,

Just curious if you are still researching ways to utilize multiple subscriptions within a single DevTest Lab.

Thanks!

0 Votes 0 ·

Hello, @EbenKrapfl-2689!

I've got an update to the recommendation and should have an answer for you later today.

1 Vote 1 ·

Thanks for the quick response!

Couple of notes:
On your comments about being able to choose the resource group to put a new VM in. I have confirmed that I have "Default resource group allocation" selected, but when I create a new VM, I do not have the option to choose a resource group. They always automatically go into the resource group assigned to the DevTest Lab.

On using Shared Image Galleries and multiple DevTest Labs instances. That would certainly work, but it takes a lot of the "nice and easy" out of it. I don't want individual devs to have to do a bunch of setup. That is the beauty of what DevTest Labs brings to the table. We can have a bunch of things setup and ready to go, required artifacts, etc. Having each dev manage all of that separately rather than in a single DevTest Lab is a LOT more configuration and teaching. Like I said, the ideal would be to be able to use multiple subscriptions within a single DevTest Lab instance, but I'm certainly open to other options to accomplish the simplest setup for devs to pickup and go with a "ready to go" VM.

Thanks again!
Eben

0 Votes 0 ·

1 Answer

kobulloc-MSFT avatar image
0 Votes"
kobulloc-MSFT answered

Hello, @EbenKrapfl-2689!

Scenario
A small company where all of the developers have Visual Studio Enterprise subscriptions with monthly Azure credits allotted to them. What is the best way to spin up "quick VMs" for devs on different subscriptions?

Recommendation
Have the devs create Compute VMs using custom images:
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource

While DevTest Labs does have the ability to create VMs using Azure Compute Gallery (formerly Shared Image Gallery), each dev would need to create a separate DevTest Labs resource for themselves and consume the images provided through Azure Compute Gallery. While this would work, it's not an ideal solution and the better route would be to simply create Compute VM resources using custom images.

Depending on your needs, you can also use Azure Compute Gallery which allows for more than 20 simultaneous deployments:
https://docs.microsoft.com/en-us/azure/virtual-machines/shared-image-galleries

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.