1
votes

Having a main ARM template and a linked ARM template, is it possible to deploy the resources from VS?

When I try that is says "The language expression property 'templateLink' doesn't exist, available properties are 12:40:36 - 'template, parameters, mode, provisioningState".

Looking it up I found answers that indicate that you have to upload the linked templates somewhere in the cloud but to me it is stupid not being able to do all of your work, including deployment, from VS.

Is there a way to deploy from VS or from a command prompt and all the templates to exist on the local drive?

2
The deployproj in VS will do this for you (upload the files) - there is no way to get ARM a link to your c: drive... - bmoore-msft
How do I upload the files (child templates) with deployproj? - Nicolae Daian
The PS1 that's included in the deployproj (which is what the VS UI uses to deploy) will upload the files for you. - bmoore-msft
I am sorry, I still cannot make my project's Deploy to upload the child templates. Based on your comment here (stackoverflow.com/questions/50906732/…) I added _artifacts location and _artifactsLocationSasToken parameters (took the sample from here: github.com/Azure/azure-quickstart-templates/blob/master/…). See the next comment for continuation. - Nicolae Daian
I reference the child template as advised in the sample. When deploying from VS I selected the default for "Artifacts storage account" field and a new storage account was created. However only the main template, the main parameters file and the PS1 script were uploaded in the blob. I expected to find the child template there too. On my machine the child templated is stored in the "NestedTemplates" folder as advised in the best practices document (above). I cannot find any "NestedTemplates" blob container in the storage account. - Nicolae Daian

2 Answers

2
votes

No, linked templates have to be uploaded to some place available to the ARM engine to fetch them. Or you can just "type" them inline, but thats is pretty tricky due to how they work compared to regular linked templates (hint - dont really use this approach).

What I usually do - upload all the templates with powershell and just reference each other with url() function

0
votes

You can deploy the template completely from VS, it will upload all the linked templates in the cloud and the do the deployment.

See the answer for this question.