Use Azure Pipelines with Slack
Azure DevOps Services
With Azure Pipelines app for Slack, Slack users can easily track the events occurring within their pipelines. The app allows users to establish and oversee subscriptions for various pipeline events, such as builds, releases, pending approvals, and more. Notifications for these events are then delivered directly to users' Slack channels
Note
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. To learn more, see Azure DevOps Feature Timeline.
Install Azure Pipelines app
Navigate to Azure Pipelines Slack app to install the Azure Pipelines app to your Slack workspace. Once added,
you'll see a welcome message from the app as below. Use the /azpipelines
handle to start interacting with the app.
Connect to your pipeline
Once the app has been installed in your Slack workspace, you can connect the app to any pipeline you want to monitor. You'll be asked to authenticate to Azure Pipelines before running any commands.
To start monitoring all pipelines in a project, use the following slash command inside a channel:
/azpipelines subscribe [project url]
The project URL can link to any page within your project (except URLs to pipelines). For example: /azpipelines subscribe https://dev.azure.com/myorg/myproject/
You can also monitor a specific pipeline using the following command:
/azpipelines subscribe [pipeline url]
The pipeline URL can link to any page within your pipeline that has a definitionId
or a buildId/releaseId
in the URL. For example: /azpipelines subscribe https://dev.azure.com/myorg/myproject/_build?definitionId=123, or: /azpipelines subscribe https://dev.azure.com/myorg/myproject/_release?definitionId=123&view=mine&_a=releases
The subscribe command gets you started with a few subscriptions by default. Here are the default notifications enabled for the following pipeline type:
Build pipelines | Release pipelines | YAML pipelines |
---|---|---|
Build completed notification | Release deployment started, Release deployment completed and Release deployment approval pending notifications | Run stage state changed and Run stage waiting for approval notifications |
Manage subscriptions
To manage the subscriptions for a channel, use the following command: /azpipelines subscriptions
This command lists all the current subscriptions for the channel and allows you to add or remove subscriptions.
Note
Team administrators are not able to remove or modify subscriptions created by Project administrators.
Customize subscriptions
By default, when subscribing to a pipeline, several subscriptions are generated that do not have any filters applied. However, it is common for users to want to personalize these subscriptions according to their preferences. For instance, users may wish to receive notifications only for failed builds or when deployments are made to production. The Azure Pipelines app offers the option to apply filters, enabling users to customize the messages they receive in their channel. To customize a subscription:
Run the
/azpipelines subscriptions
command to list all your subscriptions.Select Add subscription.
Select the event you want to subscribe to, and then select your desired configuration.
Select Save when you're done.
Example: Get notifications only for failed builds
Approve deployments
You can approve deployments from within your Slack channel without navigating to the Azure Pipelines portal by subscribing to the Release deployment approval pending notifications (classic releases) or the Run stage waiting for approval notifications (YAML pipelines). Both subscriptions are created by default when you subscribe to a pipeline.
The Azure Pipelines app for Slack enables you to handle all the checks and approval scenarios that are available in the Azure Pipelines portal. These include single approver, multiple approvers, and team-based approval. You have the option to approve requests either individually or on behalf of a team.
Remove all subscriptions
To declutter your channel, you can make use of the following commands to unsubscribe from all pipelines within a project. For example: /azpipelines unsubscribe all https://dev.azure.com/myorg/myproject.
/azpipelines unsubscribe all [project url]
Important
This command can only be executed by project administrators.
Commands reference
Here are all the commands supported by the Azure Pipelines app for Slack:
Slash command | Functionality |
---|---|
/azpipelines subscribe [pipeline url/ project url] | Subscribe to a pipeline or all pipelines in a project to receive notifications |
/azpipelines subscriptions | Add or Remove subscriptions for this channel |
/azpipelines feedback | Report a problem or suggest a feature |
/azpipelines help | Get help on the slash commands |
/azpipelines signin | Sign in to your Azure Pipelines account |
/azpipelines signout | Sign out from your Azure Pipelines account |
/azpipelines unsubscribe all [project url] | Remove all pipelines (belonging to a project) and their associated subscriptions from a channel |
Notifications in Private channels
The Azure Pipelines app can help you monitor the pipelines activity in your private channels as well. You'll need to invite the bot to your private channel by using /invite @azpipelines
. Once the bot has been added, you can configure and control your notifications in the same manner as you would for a public channel.
Note
- You can use the Azure Pipelines app for Slack only with a project hosted on Azure DevOps Services at this time.
- The user has to be an admin of the project containing the pipeline to set up the subscriptions
- Notifications are currently not supported inside direct messages
- Deployment approvals which have 'Revalidate identity of approver before completing the approval' policy applied, are not supported
- 'Third party application access via OAuth' must be enabled to receive notifications for the organization in Azure DevOps (Organization Settings -> Security -> Policies)
Troubleshooting
If you are experiencing the following errors when using the Azure Pipelines App for Slack, follow the procedures in this section.
Sorry, something went wrong. Please try again
The Azure Pipelines app uses the OAuth authentication protocol, and requires Third-party application access via OAuth to be enabled. To enable this setting, navigate to Organization Settings > Security > Policies, and turn on the Third-party application access via OAuth for the organization.
Configuration failed. Please make sure that the organization exists and that you have sufficient permissions
Sign out of Azure DevOps by navigating to this URL: https://aka.ms/VsSignout
.
Open a private/incognito browser window and navigate to https://aex.dev.azure.com/me
and sign in. Select the directory that contains the organization where the pipeline you want to subscribe to is located.
Using the same browser, open a new tab and go to https://slack.com
. Log in to your workspace using the web client, and then run the /azpipelines signout
command followed by the /azpipelines signin
.
Select the Sign in
button and you'll be redirected to a consent page as shown in the example below. Verify that the directory displayed next to your email address matches the one selected in the previous step. Select Accept to complete the sign-in process.
Related articles
Feedback
Submit and view feedback for