Azure DevOps with Slack Approvals


Posted By : Subramani Sundaram

Added :

1 Comment


Azure DevOps with Slack Approvals

Image for post

In this blog Azure DevOps with Slack Approvals you will learn about the various integration options that can be used to bring Slack and Azure DevOps closer.

Slack is deprecating the Visual Studio Teams Services (VSTS) app from its app store. This app was built by the Slack team a few years ago and provides basic integration between VSTS and Slack. The app allowed users to get notified of the events in Azure DevOps such as the creation of pull requests, updates to work items, completed builds, and more.

In addition to receiving notifications on events from Azure DevOps, these new apps support rich features such has:

  • Creating work items using a command or messaging action
  • Approving / rejecting releases from the Slack channel
  • Notifying teammates with @mention support for action
  • Unfurling URLs for work items, pull requests and pipelines
  • Supporting notifications for new YAML based pipelines

Azure Pipelines with Slack

If we use Slack, we can use the Azure Pipelines app for Slack to easily monitor the events for your pipelines.

We can set up and manage subscriptions for builds, releases, YAML pipelines, pending approvals, and more from the app and get notifications for these events in your Slack channels.

Image for post

This feature is only available on Azure DevOps Services. Typically, new features are introduced in the cloud service first, and then made available on-premises in the next major version or update of Azure DevOps Server.

Add the Azure Pipelines app to your Slack workspace

Navigate to Azure Pipelines Slack app to install the Azure Pipelines app to your Slack workspace. Once added, you will see a welcome message from the app as shown below.

Use the /azpipelines handle to start interacting with the app.

Image for post

Once the app has been installed in your Slack workspace, you can connect the app to the pipelines you want to monitor. The app will ask you to authenticate to Azure Pipelines before running any commands.

Image for post

To start monitoring all pipelines in a project, use the following slash command inside a channel:

/azpipelines subscribe [project url]

For example:

/azpipelines subscribe https://dev.azure.com/myorg/myproject/

To manage the subscriptions for a channel, use the following command:

/azpipelines subscriptions

This command will list all the current subscriptions for the channel and allow you to add new subscriptions.

Image for post

Approve deployments from your channel :

You can approve deployments from within your channel without navigating to the Azure Pipelines portal by subscribing to the Release deployment approval pending notification for classic Releases or the Run stage waiting for approval notification for YAML pipelines. Both of these subscriptions are created by default when you subscribe to the pipeline.

Image for post

Whenever the running of a stage is pending for approval, a notification card with options to approve or reject the request is posted in the channel. Approvers can review the details of the request in the notification and take appropriate action. In the following example, the deployment was approved and the approval status is displayed on the card.

Image for post

The app supports all the checks and approval scenarios present in Azure Pipelines portal, like single approver, multiple approvers (any one user, any order, in sequence) and teams as approvers. You can approve requests as an individual or on behalf of a team.

Azure Boards with Slack

Image for post

If we use Slack, you can use the Azure Boards app for Slack to create work items and monitor work item activity in your Azure Boards project from your Slack channel.

The Azure Boards app for Slack allows users to set up and manage subscriptions to create, update, and work with other item events, and get notifications for these events in their Slack channel.

Conversations in the Slack channel can be used to create work items. Previews for work item URLs help users to initiate discussions around work.

Image for post
  • To create a work item, we must be a contributor to the Azure Boards project.
  • To create subscriptions in a Slack channel for work item events, we must be a member of the Azure Boards Project Administrators group or Team Administrators group.
  • To receive notifications, the Third party application access via OAuth setting must be enabled for the organization.
  • Once after the above is done, we can see the welcome app message from the Slack channel.
Image for post

Once the app has been installed in your Slack workspace, connect and authenticate yourself to Azure Boards.

Image for post

After signing in, use the following slash command inside a Slack channel to link to the Azure Boards project which you specify with the URL :

/azboards link [project url]

for example :

/azboards link https://dev.azure.com/myorg/myproject

Create a work item with a command

  1. With Azure Boards app you can create work items from your channel. The app supports custom work items as well.

To create a work item, use /azboards create.

Image for post

You can create work items directly from a command by passing work item type and title as parameters. Work items will be created only if they do not have any fields to be mandatorily filled.

/azboards create [work item type] [work item title]

/azboards create ‘user story’ Push cloud monitoring alerts to mobile devices

we can create a work item based on the message shown below :

Image for post

This will be the preview of the work item created from the slack channel.

Image for post

Azure Repos with Slack

If you use Slack, you can use the Azure Repos app for Slack to easily monitor your Azure repositories.

We can set up and manage subscriptions to receive notifications in your channel whenever code is pushed/checked in and whenever a pull request (PR) is created, updated or a merge is attempted.

This app supports both Git and Team Foundation Version Control (TFVC) events.

Image for post
  • To create subscriptions in a Slack channel for repository-related events, we must be a member of the Azure Project Administrators group or Team Administrators group.
  • To receive notifications, the Third-party application access via OAuth setting must be enabled for the organization.
Image for post

Once the app has been installed in your Slack workspace, connect and authenticate yourself to Azure Repos using /azrepos signin command.

Image for post

To start monitoring all Git repositories in a project, use the following slash command inside a channel ,

/azrepos subscribe [project url]

/azrepos subscribe https://dev.azure.com/myorg/myproject/

For GIT:

/azrepos subscribe https://dev.azure.com/myorg/myproject/_git/myrepository

For TFVC :

/azrepos subscribe https://dev.azure.com/myorg/myproject/_versionControl

The subscribe command gets you started with a default subscription. For Git repositories, the channel is subscribed to the Pull request created event (with target branch = master), and for TFVC repositories, the channel is subscribed to the Code checked in event.

Image for post

To view, add and remove subscriptions for a channel, use the subscriptions command:

/azrepos subscriptions

Image for post

Example: Get notifications only when my team is in the reviewer list for a PR

Image for post

Example: Tell me when merge attempts fail due to a policy violation

Image for post

When a user pastes the URL of a PR, a preview is shown like the one in the following image. This helps to keep PR-related conversations contextual and accurate.

Image for post

These are the 3 main SLACK APP which is mainly used for Azure DevOps.We can have this integrated and do the day 2-day work being in the slack itself.

Related Courses

VILT & Self-Paced

AZ-204 Developing Solutions for Microsoft Azure

This self-paced course will help you prepare for the Azure Developer certification exam AZ-204: Developing Solutions for Microsoft Azure.

Self-Paced

AZ-900: Microsoft Azure Fundamentals Tutorial

AZ-900: Microsoft Azure Fundamentals Tutorial provides foundational level knowledge on cloud concepts; core Azure services; security, privacy, compliance, and trust; and Azure pricing and support.

Self-Paced

AZ-400 Designing and Implementing Microsoft DevOps Solutions

This self-paced course will help you prepare for the Azure DevOps certification exam AZ-400: Designing and Implementing Microsoft DevOps Solutions.

0 0 votes
Article Rating
Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
kipster521
kipster521
6 months ago

We have an issue where two approvers in the approver list in our release pipeline predeployment approvals, cannot approve in Slack. Their names are not highlighted like the rest who can approve. We have removed and re-added them in the approver list on the predeployment approval but it doesn’t seem to work and they do have the necessary permissions in Azure Devops to approve. Any ideas?