Azure / template-specs

MIT License
31 stars 4 forks source link

How will template specs integrate with Azure DevOps? #30

Closed lunar87 closed 4 years ago

lunar87 commented 4 years ago

Although you can version template specs, how do you see integrate template authoring lifecycle with source contral as well as template spec deployements with Azure DevOps pipelines? Are there template spec pipeline tasks that are planned to assist with this?

alex-frankel commented 4 years ago

Pushing the Template Spec to Azure is like releasing an update to an "app" or a release to powershell gallery, npm, etc. So the idea is that you should be iterating on your templates locally, validating that they work, etc. Once the template is determined to be valid, push a new version to Azure so others can consume it.

As of now, there is a not a task planned, but I can certainly see us creating something to make the process easier.

alex-frankel commented 4 years ago

@lunar87 - does my answer help clarify? If I don't hear from you I will plan to close this tomorrow.

lunar87 commented 4 years ago

When you say 'push to Azure' what does that mean? As an example, user works on template locally, pushes to github then pipeline in DevOps will execute New-AzTemplateSpec? I think we should provide guidance on how templatespec fits with these other options as either value-add or alternative. If alternative then what are trade-offs?

alex-frankel commented 4 years ago

What you describe is exactly right. TemplateSpecs are not an alternative to managing templates in source control. All templates should be authored and tested locally and checked in to source control accordingly. If (and only if) you want to share that template privately within an Azure tenant, you can choose to publish (push) it to Azure with the powershell cmdlet or CLI command.

You can choose to set up a pipeline that, once the template is validated, will push a new version of the TemplateSpec to Azure. You may want to take advantage of things like GitHub releases to manage this. For each release, that can map to a TS version in Azure.

We will take an action item to document some strategies here for managing this. cc @mumian / @tfitzmac

tfitzmac commented 4 years ago

Thanks for this feedback. I have added a work item for this addition to the documentation.

jatinbhalla commented 3 years ago

I have main and linked templates in Azure repo and using Azure powershell in CI i was trying to create template spec. but CI throws an error.

[error]The term 'Get-AzTemplateSpec' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

While these commands are working fine from local machine. Can someone help me to resolve this

alex-frankel commented 3 years ago

My guess is the Azure PowerShell DevOps task is not up to date with the latest version of the public PowerShell Az module. You should be able to install the latest version as part of your pipeline task before calling the *-AzTemplateSpec tasks that you need.