Azure DevOps pipeline integration to Microsoft Teams

Table Of Contents

Intro

I want to show how to add Azure DevOps into Microsoft Teams in this post. I will show how to add the App to Teams and integrate it with the DevOps pipeline. The integration will display any pipeline actions, and it will also post any approval action into teams. With this integration, you can delegate activities in DevOps to coworkers who are not comfortable with Azure DevOps but are very pleased with Teams. In short, let us use Teams to ease the interaction with Azure DevOps.

I made a video demo of all the steps in this post, find the video here:

https://youtu.be/MkjzfBLtkSc

Credits to Microsoft for great information and guides, which you can find here:

https://docs.microsoft.com/en-us/azure/devops/pipelines/integrations/microsoft-teams?view=azure-devops

Create a new team in MS Teams

First, I will create a new team in Teams. I do this by clicking on “Join or create a team.”

Next, I click on “Create a team.”

I will choose “From scratch.”

I will select “Public” visibility but choose what fits your needs..

I provide a name for the team and click “Create.”

Last, I will “Skip” since I am not adding members to the team now.

With the team in place, I can add the Azure DevOps app to Teams.

Adding Azure DevOps app to MS Teams

First, I click on “Apps.”

I will search for “Azure Pipeline.”

I will click on the small down arrow and select “Add to team”

I will start typing the team name and select it as it shows in the dropdown. I can then click on “Set up a bot.”

I now have an active bot configured.

I need to sign in before I can get notifications from Azure DevOps. To sign in, I will use the command below.

@Azure Pipelines signin

I need to accept read and write access from Teams into Azure DevOps.

Now that I am signed in, I can subscribe to individual pipelines or all pipelines. In my example, I will subscribe to all pipelines. I will use the command below. Remember to use the path to your organization and project.

@Azure Pipelines subscribe https://dev.azure.com/Cloudninja-**/Deploy-***

Azure DevOps will report back to teams that the subscription is active.

I will manually start my pipeline and see what gets reported back to teams. As shown below, I can see the pipeline has begun.

The pipeline will return status when complete. As shown below, the status is “Success.”

Pipeline approval in Teams

The last item in this post will be to approve a build from Teams. I will add a new subscription by using the command below.

@Azure pipelines subscriptions

I can now click on “Add subscription.”

I select the event “Release deployment approval pending” in the list.

I select “Any release: Deploy-****.”

I select “Any” on both “Stage name” and “Approval type.”

There are more subscriptions that I can make, and I did add a few more so that I get notified on release starts and completion.

With those subscriptions in place, I can start my release pipeline, and a few seconds later, I see the approval below.

After I have clicked on “Approve,” the pipeline will run, and I will get notified in Teams that I did approve it and a bit later that it ran with success.

Summary

The post got to be a bit longer than I expected, but I wanted to cover the steps here in detail to be easy to follow. Adding Azure DevOps to Teams is something I recommend to ensure that those employees that are not always in Azure DevOps can still follow the development process and act as approvers for pipelines.

I am working on a blog post where I will add the kanban boards and dashboards from Azure DevOps into a Teams channel.

I hope this post has been informative, and please reach out for any comments or feedback.

Comments