2
votes

I have an ARM Template stored in Azure Templates.

Is there a way to reference this template from script (either in Azure Cloud Shell or PowerShell/CLI on local machine)? Right now it seems the only way to deploy the template is through the Azure portal UI.

Update

I wanted to clarify what I am asking. I am asking specifically about Azure Templates (Preview) service. It seems that once you store a template in Templates service the only way to access it is through the Azure portal.

For example, let's say I am creating a VM in Azure portal. I can save the ARM template to Templates service as shown in the images below.

You can click on Download Template and parameters link, on next page click on Add to library to save the template to Templates service (Templates service can be found in Azure portal through All Service > filter for "Templates").

I was doing the course on edX.org: Automating Azure Workloads and it was talking about this service, that's why I became interested in this service.

Create VM pane

enter image description here

enter image description here

1
did you ever manage to solve this, or did you just publish to an external source?Dan Cundy

1 Answers

0
votes

You can deploy a template with every possible mean you mention. Not only the portal UI.

There is documentation here - section Deploy a template from external reosurce (also explains how to deploy from a private resource using SAS:

New-AzureRmResourceGroupDeployment -Name ExampleDeployment -ResourceGroupName ExampleResourceGroup `
  -TemplateUri https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-storage-account-create/azuredeploy.json `
  -storageAccountType Standard_GRS

The referenced documentation also provides sample for use with Cloud Shell.