Git Product home page Git Product logo

multi-stage-azure-pipeline-automation's Introduction

Using Logic App to Automate Azure DevOps Multistage Pipelines

This repository explains the deployment scenario of the reference architecture published in azure architecture center. It contains an Azure Resource Group Project that provisions an Azure Logic App. The Logic App interacts with Azure DevOps API to automate the provisioning of Multi Stage Pipelines

The source code contains the following files

  • LogicApp.json - ARM template that provisions the logic app
  • LogicApp.parameters.json - Parameter file that is passed as inputs to ARM template to provision the Logic App

Replace the parameters with relevant values for azure devops organization, project and the PAT token.

After Development phase, be sure to save ARM template secrets as securestring. Most importantly fetch those secret from azure keyvault

Prerequisites

You need the following pre-requisites to deploy the project

  • An Azure Subscription with some credits
  • An Azure DevOps Account with project administrator role
  • An active Azure DevOps Project
  • PAT token from Azure DevOps
  • Visual Studio 2022 or latest

Deploy Azure Resources

You can choose to deploy this project from Visual Studio or using Azure Cloud Shell The steps below show how to deploy ARM template from within Visual Studio

Alternatively, you can also choose to run the deployment script, from within Azure Cloud Shell, clone this repository to your local machine, switch to the multistage-azure-pipeline-automation-logicapp folder and upload the template & paramter json files to clouddrive

Azure Cloud Shell

Now run the following commands :

az group create \
  --name azdevops-multistage-pipelines \
  --location "West Europe"
az deployment group create \
  --name prodenvironment \
  --resource-group azdevops-multistage-pipelines \
  --template-file LogicApp.json \
  --parameters LogicApp.parameters.json

Read more about how to use parameter files to deploy your ARM template here

Adding LogicApp as Service Hook to Azure DevOps project

  • Once the Logic App is provisioned, copy the trigger URL
  • Go to Project Settings in Azure Devops and select service hooks
  • On Code Pushed event, configure the webhook to call the HTTP Trigger URL of the Logic App you previously copied

Now for every codepush event detected across any repository within that azure devops project the logic app will invoke the azure devops api to configure the multistage pipelines based on the pipeline definition yaml file located in the root of the repository

This way you have a repeatable deployment pattern across all your repsositories within the azure devops project

Service Hooks

Now your setup will correspond to the representation of the following architecture

Architecture

multi-stage-azure-pipeline-automation's People

Contributors

raj-microsoft avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.