A Sample of “Azure DevOps Release Gate ” the Gates with the following items
- Query work items: Query Active Bug
- SonarQube: ” Invoke REST API: POST”
- Azure monitor: Azure monitor Alert
Software infra:
Based on ” Controlling Deployments using Release Gates | Azure DevOps Hands-on-Labs (azuredevopslabs.com) ” and ” Managing technical debt with SonarQube and Azure DevOps | Azure DevOps Hands-on-Labs (azuredevopslabs.com) ”
- 2 Web app for sample canary and production
- sonarqube in Azure Container Instance
AprRG="1TL-MyResourceGroup" RNUMBER="041822" az group create -n $AprRG -l eastasia az appservice plan create -g $AprRG -n MyPlan --sku S1 az webapp create -g $AprRG -p MyPlan -n "PartsUnlimited-$RNUMBER-Canary" az webapp create -g $AprRG -p MyPlan -n "PartsUnlimited-$RNUMBER-Prod" RG_ID=$(az group create --name $AprRG --location "eastasia" --query "id" --output tsv) SERVICE_PRINCIPAL_NAME="Exzilla-sp-$RNUMBER" PASSWORD=$(az ad sp create-for-rbac --name $SERVICE_PRINCIPAL_NAME --role contributor --scopes $RG_ID --query "password" --output tsv) USER_NAME=$(az ad sp list --display-name $SERVICE_PRINCIPAL_NAME --query "[].appId" --output tsv) az container create -g $AprRG --name sonarqubeaci180422 --image sonarqube --ports 9000 --dns-name-label mysonarqube200422 --cpu 2 --memory 3.5 #curl -u ea---fe: http://sonarqubeaci180422.exzilla.com:9000/api/qualitygates/project_status?projectKey=MyShuttle
Hint: Azure DevOps Release Gate with Azure DevOps Starter
To build quick demo for “Release Gate” with condition from Azure Board, Azure Monitor and SonarQube
- DevOps Starter ” .NET Core -> App Service ”
- Add SonarQube in “build” Pipeline
- Add Release ” UAT” Stage (Then, we have Dev & UAT)
- Add “Pre-deployment approvals”
- Add “Pre-deployment Gates” ” Query work items”
Azure DevOps -> Boards -> Queries -> Active Bugs -> … -> Security -> ReleaseGate Build Service(myOrg) -> Read ( Allow ) - Add “monitoring” gate in “Dev” Stage
- Add Agentless Job in Tasks( manual Intervention )
- Add ” Post-deployment approvals” Gate “Query Azure Monitor Alerts”
- Add ” Post-deployment approvals” Gate “Invoke REST API:POST”
#URL suffix: api/qualitygates/project_status?projectKey=MyShuttle #success critirial: eq(root['projectStatus'].status,'OK')
Sample of Canary releases (ref: What are deployment patterns? – Learn | Microsoft Docs )
DevTest and DevOps for microservice solutions
Labs:
- https://docs.microsoft.com/en-us/azure/devops/pipelines/release/approvals/?view=azure-devops
- https://docs.microsoft.com/en-us/labs/devops/sonarcloudlab/
- https://azuredevopslabs.com/labs/vstsextend/sonarqube/
- Manage release cadence in Azure Pipelines by using deployment patterns – Learn | Microsoft Docs
See Also:
- https://www.azuredevopslabs.com/labs/vstsextend/releasegates/
- https://docs.microsoft.com/en-us/azure/devops/boards/queries/wiql-syntax?view=azure-devops
- https://docs.microsoft.com/en-us/azure/devops/pipelines/release/deploy-using-approvals?view=azure-devops
- https://docs.microsoft.com/en-us/azure/architecture/example-scenario/serverless/microservices-with-container-apps
- https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/kubernetes/deployment-strategies?view=azure-devops
- https://docs.microsoft.com/en-us/azure/devops/boards/queries/view-run-query?view=azure-devops&tabs=browser