1
votes

I am currently planning on a type of multi-tenant system, were different resource groups with a set of AppServices are deployed for customers via ARM Templates. Hence, each customer has its own Resource Group and set of AppServices. Currently we use Azure DevOps to deploy to a set of AppServices used for Development and Quality Assurance before it gets to Production. I am now trying to incorporate DevOps into the mix, automating a pipeline creation of some sort... (it would be a copy of an existing pipeline but only changing the Target AppServices). Which is were my question comes from, Is there a way to dynamically create or edit a Release pipeline to add the deployment of those new AppServices, without the need of manually edit or create a pipeline an adding those newly created AppServices, I was thinking something around the lines of being able to copy a yaml file template then replacing the necessary info to point to those AppServices after they have been created, but I am not totally sure where could I store the new yaml file so that it is picked up by Azure DevOps, or how could I would accomplish these, with the main idea being that all of this continues to be part of an automated process (if possible).

Thanks a lot for any help, any suggestion is appreciated.

EDIT:

The question is not about how to Deploy an ARM Template through the DevOps release pipeline (I plan on using a PowerShell Script/REST API to accomplish that), instead, is about when the AppServices Resources are created, I need to deploy code to those newly created AppServices and also update that code when necessary (Hopefully through a Release Pipeline), somehow generate a new release pipeline each time I deploy a new set of Resources. So that, when there is a new update, I could easily have that pipeline triggered and that set if AppServices can be updated (created as part of the automation process "dynamically"). (I Already have a similar pipeline that deploys to a "static" set of AppServices)

1
PT 1. I still don't think the question has been answered, DreadedFrost's response was very useful (I currently can't upvote, if not I would) but it is not the answer. I do know I'm not going to find a definite answer for this problem, but at least something closer to what the question refers to, which in summary is the following: Is there a way to dynamically generate a Release pipeline AFTER deploying new App Services using an ARM Template in the most automated way. - Juan P. Garces
PT 2. I already know what the YAML Template could look like to deploy to the AppServices, but I would need to know how would I trigger a new pipeline for each of the new AppServices created (via ARM). If I am missing something from DreadedFrost's answer that is the answer to my question, then I apologize. Thanks - Juan P. Garces
Why do you need to generate a new release pipeline every time? If you need to update the resource, just update the template and deploy again to cover it. - Hugh Lin

1 Answers

0
votes

This is possible as you eluded to with YAML Pipelines. Based upon the scenario you have subscribed each repository would have it's own pipeline.yml file that will define the trigger, pool etc. It would also reference a repository that will house your yaml template.

The template would accept whichever parameters you may required (resource group, app service name, etc...) The triggering pipeline associated with each repository would pass this information leveraging the teamplate.

By doing this CI/CD can be set up to trigger on the individual pipelines and deploy the appropriate code all while leveraging the same YAML template.

The repository reference would be similar to:

resources:
  repositories:
  - repository: YAMLTemplates
    type: git
    name: OrginazationName/YAML Project Name

With the call to the template being similar to:

- template: azure-ARM-template.yml@YAMLTemplate
  parameters:
    appServiceName: 'AppServiceName'
    resourceGroupName: 'ResourceGroupName'

UPDATE
At a high level the YAML pipeline would consist of the following. If all App Services are similar as stated and ARM Templates are similar this how it could be constructed and triggered based on a folder path:

Release the deployment pieces for each environment in appropriate stages to help alleviate the amount of copying and pasting each of the above tasks can be part of a template either individually at a task, combination of tasks, or all in one. This would allow for defining the YAML once and referencing it and including app specific components as needed as parameters to the templates.