Answered by:
Azure Git Repo Triggers

Question
-
I'm trying to understand if the following use cases can be implemented in Azure as automatic tasks:
Create Branch
- Branch created in Azure Git repo
- Build pipeline started to create a docker image and push to Azure container registry
- Release pipeline deploys creates AKS cluster and deploys application
Update Branch
- Code is pushed to branch
- Build pipeline started to create a docker image and push to Azure container registry
- Release pipeline upgrades AKS cluster so that the containers are restarted pulling in the new container image, no need to recreate the AKS cluster.
End of Merge Request/Delete Branch
- When branch is deleted in the Azure Git repo call script/pipeline to teardown AKS cluster
I have scripts to do all the above manually but am struggling to understand how to do it all automatically.
- Moved by Femisulu-MSFT Tuesday, March 5, 2019 5:28 AM better suited here- dev ops
- Moved by BharathN-MSFTMicrosoft employee Thursday, March 7, 2019 7:26 PM Directed to Azure DevOps Forum
Saturday, March 2, 2019 11:59 AM
Answers
-
Hi Rob3rtWard,
The Azure DevOps team and community are active and answering questions on https://developercommunity.visualstudio.com/spaces/21/index.html can you please post your question there instead? This forum is specifically for Azure Dev Test Labs questions.
- Proposed as answer by Guido Franzke Friday, March 8, 2019 9:21 AM
- Marked as answer by Richard MuellerMVP, Banned Friday, March 15, 2019 12:01 PM
Thursday, March 7, 2019 7:25 PM -
Azure devops forum is on StackOverflow
https://stackoverflow.com/questions/tagged/azure-devops
or also try here.
https://developercommunity.visualstudio.com/spaces/21/index.html
there are four general locations for Azure communities.
https://azure.microsoft.com/en-us/support/community/
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Guido Franzke Friday, March 8, 2019 9:21 AM
- Marked as answer by Richard MuellerMVP, Banned Friday, March 15, 2019 12:01 PM
Thursday, March 7, 2019 7:47 PM -
Hello Rob3rtWard,
Most of the tasks that you mentioned can be automated using Azure DevOps Services.
You can configure these as tasks in your Build Pipeline, using the Visual designer:
- The Docker container template in the Featured list of templates
should help you build and push a docker image to your Container Registry.
The build pipeline is driven by the configured Triggers.
You can then configure your Release Pipeline to process the deployment:
- Start with the Empty job template, and you could use a Powershell/Azure CLI task to create an AKS cluster and deploy your application. There are many options available in the form of Predefined
Build and Release tasks to do the same, as shown in the screenshot below, or even come up with your own Custom
Tasks.
- You could configure the deployment to your cluster using the Deploy to Kubernetes task or one of the Helm tasks.
However, there is no out of the box way to trigger a Pipeline upon branch deletion AFAIK. Having said that, you could create a separate Pipeline with a Powershell/CLI task that automates the deletion and cleans up other resources, and trigger it manually as needed.
Hope this helps!
- Proposed as answer by BhargaviAnnadevara-MSFTMicrosoft employee Friday, March 8, 2019 1:18 PM
- Edited by BhargaviAnnadevara-MSFTMicrosoft employee Sunday, March 10, 2019 6:04 AM
- Marked as answer by Richard MuellerMVP, Banned Friday, March 15, 2019 12:02 PM
Friday, March 8, 2019 1:15 PM - The Docker container template in the Featured list of templates
should help you build and push a docker image to your Container Registry.
All replies
-
Hi Rob3rtWard,
The Azure DevOps team and community are active and answering questions on https://developercommunity.visualstudio.com/spaces/21/index.html can you please post your question there instead? This forum is specifically for Azure Dev Test Labs questions.
- Proposed as answer by Guido Franzke Friday, March 8, 2019 9:21 AM
- Marked as answer by Richard MuellerMVP, Banned Friday, March 15, 2019 12:01 PM
Thursday, March 7, 2019 7:25 PM -
Azure devops forum is on StackOverflow
https://stackoverflow.com/questions/tagged/azure-devops
or also try here.
https://developercommunity.visualstudio.com/spaces/21/index.html
there are four general locations for Azure communities.
https://azure.microsoft.com/en-us/support/community/
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Guido Franzke Friday, March 8, 2019 9:21 AM
- Marked as answer by Richard MuellerMVP, Banned Friday, March 15, 2019 12:01 PM
Thursday, March 7, 2019 7:47 PM -
Hello Rob3rtWard,
Most of the tasks that you mentioned can be automated using Azure DevOps Services.
You can configure these as tasks in your Build Pipeline, using the Visual designer:
- The Docker container template in the Featured list of templates
should help you build and push a docker image to your Container Registry.
The build pipeline is driven by the configured Triggers.
You can then configure your Release Pipeline to process the deployment:
- Start with the Empty job template, and you could use a Powershell/Azure CLI task to create an AKS cluster and deploy your application. There are many options available in the form of Predefined
Build and Release tasks to do the same, as shown in the screenshot below, or even come up with your own Custom
Tasks.
- You could configure the deployment to your cluster using the Deploy to Kubernetes task or one of the Helm tasks.
However, there is no out of the box way to trigger a Pipeline upon branch deletion AFAIK. Having said that, you could create a separate Pipeline with a Powershell/CLI task that automates the deletion and cleans up other resources, and trigger it manually as needed.
Hope this helps!
- Proposed as answer by BhargaviAnnadevara-MSFTMicrosoft employee Friday, March 8, 2019 1:18 PM
- Edited by BhargaviAnnadevara-MSFTMicrosoft employee Sunday, March 10, 2019 6:04 AM
- Marked as answer by Richard MuellerMVP, Banned Friday, March 15, 2019 12:02 PM
Friday, March 8, 2019 1:15 PM - The Docker container template in the Featured list of templates
should help you build and push a docker image to your Container Registry.