Share via


Deploy from Library Template

Question

Monday, April 10, 2017 5:39 AM | 1 vote

Hi all, relatively new to Azure, and Google is failing to help.

I have a Resource Group that I have viewed the "automation script" on, and chosen "Add to Library".

I can view the template fine in the portal, however when I deploy via REST API I don't know how to find out the URI of this saved template.

Could somebody confirm if this is possible, and if there's a way to work out what I should pass through to API to achieve this :)

Thanks!

All replies (7)

Monday, April 10, 2017 7:05 PM

Does your template reside in a storage account?

Note: Your template can be either a local file or an external file that is available through a URI. When your template resides in a storage account, you can restrict access to the template and provide a shared access signature (SAS) token during deployment.

For more information, see “Deploy resources with Resource Manager templates and Azure portal”.

And also, you may refer “How to use the Resource Manager REST API with Resource Manager templates to deploy your resources to Azure”.


Tuesday, April 11, 2017 3:06 AM

The template is stored in the "Templates" repository. My question really is... "what is the URI of a document that is stored in the templates repository?"

If I click on the "Add to Library" button while viewing the automation script on a Resource Group, this seems to be the location that the template is saved to


Tuesday, April 11, 2017 8:15 PM

Note: Your template can be either a local file or an external file that is available through a URI.

As you template is available in Azure portal =>Templates.

I would recommend you save the file to local and use the template while you deploy with REST API.

Workaround to save the template in Local file system:

Go to Templates => right click and select Deploy => Edit template => Click on Download

Then, save the file in the desired location on the local file system.  

    

For more information, see “Get started with private Templates on the Azure Portal”.


Wednesday, April 12, 2017 12:43 AM | 1 vote

Thanks, I'm aware that can be done, however I'm starting to understand that files in the template respository can't be used for deployment via specifying a URI. I'm building a web application that handles the deployment process so downloading files locally doesn't meet my usage case.

I will instead keep the files into a storage account as the API support around this template repository seems to not really exist.

Thanks for your help :)


Thursday, April 13, 2017 2:36 PM

Note: You can’t get a URI for the templates in the library (on portal) that you can use to invoke.

Currently, you have a couple of options for continuing to work with this template. You can either download the template and work on it locally with a JSON editor. Or, you can save the template to your library and work on it through the portal.

If you are comfortable using a JSON editor like VS Code or Visual Studio, you might prefer downloading the template locally and using that editor. If you are not set up with a JSON editor, you might prefer editing the template through the portal. The remainder of this topic assumes you have saved the template to your library in the portal. However, you make the same syntax changes to the template whether working locally with a JSON editor or through the portal.

For more information, see “Export an Azure Resource Manager template from existing resources”.

You can share your feedback here “Azure Resource Manager”. All the feedback you share in these forums will be monitored and reviewed by the Microsoft engineering teams responsible for building Azure.


Friday, June 15, 2018 1:17 AM | 1 vote

Pradeep, I think you've missed the context of the question. 

I have the same or similar use case:

  • Need to deploy infrastructure using some automation (like VSTS). 
  • Need to utilize 'linked' templates (not simply 'nested').
  • Need to source Templates from private GitHub repo and cannot not be exposed publicly.
  • Need to deploy without having to stand-up and manage all the overhead of storage infrastructure & SAS Token parameterization that comes along with it.

Desire:

  • Publish the Linked Templates to the (Preview) Templates Library in VSTS from GitHub. 
  • Deploy a 'wrapper' Template which 'references' the necessary Template(s) from the Templates Library.

The net result is being able to quickly & painlessly switch from monolithic Templates to bite-sized ones without having to jump through all the hoops currently required. 


Saturday, June 16, 2018 5:16 AM

You may refer “Deploying Linked ARM templates with VSTS”.

In order to assist best on your query, I would request you to post your query in SO => Azure Resource Manager arm-template dedicated support. Additionally, adding the [Azure] tag on SO will increase visibility as it is a Microsoft Sponsored tag.

https://stackoverflow.com/questions/tagged/azure-resource-manager

This will assist you with a faster reply to your query.

If this answer was helpful, click “Mark as Answer” or “Up-Vote”. To provide additional feedback on your forum experience, click here