Azure / Enterprise-Scale

The Azure Landing Zones (Enterprise-Scale) architecture provides prescriptive guidance coupled with Azure best practices, and it follows design principles across the critical design areas for organizations to define their Azure architecture
https://aka.ms/alz
MIT License
1.72k stars 975 forks source link

Unable to deploy Enterprise-Scale templates from command-line #204

Closed tobyscales closed 4 years ago

tobyscales commented 4 years ago

Describe the bug Referencing the deployment().templateLink.uri property only works if the template is being run from a repo URL (as happens when clicking Deploy to Azure). When the template repo is cloned and the deployment run locally, that property is missing so the deployment fails. I verified this problem exists with Wingtip, Contoso and AdventureWorks.

I have worked around this in my own templates by using a conditional variable like so: "thisRepoUri": "[if(contains(deployment().properties, 'templateLink'), deployment().templateLink.uri, 'https://raw.githubusercontent.com/tescales/azure-letsencrypt/master')]"

Steps to reproduce

  1. git clone
  2. az deployment tenant create --template-file xxx.json

Screenshots image

krnese commented 4 years ago

Thanks. The templates are optimized for portal deployment, and to be deployed using the URIs for the main - as well as the linked templates depending on your selection. Is there a reason why you want to deploy via cli for bootstrapping?

krnese commented 4 years ago

For completeness - here's how you would deploy the reference implementation using command-line: New-AzTenantDeployment -Name -Location -TemplateUri "https://raw.githubusercontent.com/Azure/Enterprise-Scale/main/docs/reference/wingtip/armTemplates/es-foundation.json"