question

MohamadCHHIMI-7584 avatar image
0 Votes"
MohamadCHHIMI-7584 asked kobulloc-MSFT commented

I'm not able to connect a Devops repository to create my own environment ARM template into DevTest lab. How to debug this issue?

Hello,

I'm trying to add a personal AZURE DevOps repository to my AZURE DevTest Lab to create my own ARM template .
I succeeded to connect the repository to visualise my custom artifacts, but I'm not able to visualise my custom ARM template's environments.
To accomplish that I used an environment ARM template form the public repository on GitHub and I copied it on my personal DevOps repository and doesn't appear in the list of my available environments. ( For example the WebApp-MySQL environment)

How can i debug this issue ?

Best regards
Mohamad



azure-devtestlabsazure-dtl-arm-enviorments
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.

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

Hello again @MohamadCHHIMI-7584,

When completing the documentation to add template repositories to the lab, it looks like the issue is the expected Azure Resource Manager template folder path. Each environment needs to be in its own folder and the recommendation is to have those folders in an environments/templates folder.

For example, I have a copy of the WebApp template that I've made some modifications to. My GitHub repository looks like this:

MyGitHubRepository/MyTemplates/MyWebAppTemplate


144655-image.png


When adding the Azure Resource Manager template repository, I need to enter the parent folder for the Azure Resource Manager template folder path:

/MyTemplates


144714-image.png


After doing this, I'm able to see my ARM environment when creating a new lab:

144733-image.png


image.png (9.0 KiB)
image.png (68.2 KiB)
image.png (133.2 KiB)
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.

kobulloc-MSFT avatar image
0 Votes"
kobulloc-MSFT answered MohamadCHHIMI-7584 commented

Hello, @MohamadCHHIMI-7584!

Thank you for reaching out! Azure DevOps and its services are not supported in Microsoft Q&A because the Azure DevOps team and DevOps community are actively answering questions here:

https://developercommunity.visualstudio.com/spaces/21/index.html

· 1
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 kobulloc-MSFT,

It's more a question about ARM templates for environments in the AZURE DevTest Lab.
My repository is functional on AZURE DevOps, I validate it with the custom artifacts and it works fine.

My problem is why ARM templates for environments doesn't appear correctly in the available environment to deploy in the DevTest lab services.
NB: I used a public ARM template example for environment, how is functional from the public environment repo on GitHub and I copied it on my personale repo

Best regards
Mohamad

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

Hello @MohamadCHHIMI-7584,

Let's start out with the following and see where you are running into trouble:

Add template repositories to the lab
https://docs.microsoft.com/en-us/azure/devtest-labs/devtest-lab-create-environment-from-arm#add-template-repositories-to-the-lab

  1. In your lab resource, go to Settings > Configuration and policies

  2. Under external resources, click on Repositories and then Add a repository

  3. Complete the wizard and Save


142363-image.png

142364-image.png

142365-image.png


After successfully completing that, you should see your repository listed:

142319-image.png



image.png (78.6 KiB)
image.png (48.8 KiB)
image.png (27.7 KiB)
image.png (205.9 KiB)
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.

MohamadCHHIMI-7584 avatar image
0 Votes"
MohamadCHHIMI-7584 answered kobulloc-MSFT commented

Hello @kobulloc-MSFT ,

I made exactly the same steps.
I added the repository, one for artifacts and one for environments.
For the artifacts repo i can see my custom artifact in the available artifacts list.
142392-image.png
142376-image.png

For the environments i can't see my custom environments. Only public environments are visible in the list of available environments.
When i save my configuration we can see that AZURE try to populate the AZURE Resource manager template cache.
142386-image.png

Then it's saved correctly.
142402-image.png

When i go to deploy a custom environments only public environment are available. My custom environments doesn't appear.
142403-image.png


Best regards
Mohamad



image.png (76.7 KiB)
image.png (44.8 KiB)
image.png (104.3 KiB)
image.png (113.1 KiB)
image.png (64.5 KiB)
· 1
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 @MohamadCHHIMI-7584,

Sorry for the delay on my end (we've had some major storms in the area). I thought this might be related to the path used for the Azure Resource Manager template folder path but I'm getting similar results. I'm continuing to investigate.

0 Votes 0 ·
MohamadCHHIMI-7584 avatar image
1 Vote"
MohamadCHHIMI-7584 answered kobulloc-MSFT commented

Hello @kobulloc-MSFT ,

Thank you for your answer. The problem is resolved.
I can now see my custom environment.
144844-image.png

Best regards
Mohamad



image.png (21.3 KiB)
· 2
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.

Good to hear that everything is working, @MohamadCHHIMI-7584!

0 Votes 0 ·

Hello,

How did you solve this? We have same issue, but in our case also Artifacts are not visible. I tried I repo on Github and Azure DevOps. Would be great if you could share your solution to us. Thank you in advance.

0 Votes 0 ·
boswei avatar image
0 Votes"
boswei answered kobulloc-MSFT commented

Thank you very much for your response and help kobulloc-MSFT. For me it is not completely clear yet.

So i would appreciate it very much if you could answer following:

Which folder structure did you create in the root of your repo?

Something like this

Main (branch)
/Artifacts/
/Templates/

And no extra folder below? Ex. /Templates/VM/

And did you have to add a special reference in the Arm templates? We want to add a simple VM template (based on quickstart templates) Or are there no further requirements? And are ARM templates ony visible under DevTest lab Environments or can the the DevTest lab user select them also as Base ‘image’ from the list?

Thank you!

· 2
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.

Solved it!

Used

Main branch

Added below folders in the DevTest lab Repositories screen:

/Artifacts
/Environments

For the specific Artifacts and Arm templates I placed separate folder on the main folder my repo (ex. Environments\VM

`I also tried the main folder name Templates instead of Environments and that worked also. I looked at the public Github folder structure as reference. Now the templates show under My Environments in the main screen of DevTest labs user and under Claimable Virtual Machines.

So no further answering/ support necessary. Thank you!

2 Votes 2 ·

@boswei, happy to hear that you were able to solve it! Thank you very much for sharing your solution with the rest of the community.

1 Vote 1 ·