Microsoft Azure Pipelines
Azure Pipelines is a DevOps service that allows you to build, test, and deploy code projects and make them available to any user. This workflow creates change records so you can monitor the impact of Azure Pipelines service hooks on your service health. You can then build automations to update stakeholders, or send messages to respond to events in Azure Pipelines.
How it works
When an alert is generated in Azure Pipelines, it sends a JSON-formatted webhook to xMatters. An Azure Pipelines trigger in xMatters parses the webhook and creates a change record. The webhook includes essential data about the change to help you build automated tasks.
Install the workflow
The following instructions describe how to install the workflow through the xMatters one-click installation process.
- Go to the Workflow Templates page and click the Azure DevOps Pipelines tile.
- On the Set up the Workflow tab, give the workflow a name that identifies its purpose (this must be unique in your instance), add an optional description, and set the default incident type (if applicable). Any built-in Initiate Incident steps in the workflow will automatically be set to the selected incident type.
- You can edit these later, if needed.
- Click Next to set up the connection.
- Choose the authentication method. A trigger URL is generated based on the selected authentication method.
- Copy the trigger URL — you’ll use the URL to configure the webhook in Azure Pipelines.
- The trigger URL does not include a recipient parameter, but you can add one to notify an impacted or associated service of the change.
- Send a test signal to the trigger URL to test the connection.
- Click Open Workflow to go to the workflow and customize it, or click Close to close the installation window.
Configure Azure Pipelines to send requests to the trigger URL
To have Azure Pipelines send alerts to the flow trigger, you need to configure a webhook and set it to use the trigger URL.
- In Azure Pipelines, click Project settings at the bottom of the left-hand menu.
- Click Service hooks on the left-hand menu to open the Service Hooks page. Click the green plus sign to add a new service hook.
- In the Service window, select Web Hooks from the left-hand menu, and then click Next.
- In the Trigger window, fill in the following fields:
- Trigger on this type of event field: Select one of the following xMatters-supported options:
- Build completed
- Release deployment completed
- Release deployment approval completed
- Run stage approval completed
- Filters: Set your filters. (optional)
- Trigger on this type of event field: Select one of the following xMatters-supported options:
- Click Next.
- In the Action window, fill in the following fields:
- URL: Paste the trigger URL you copied from Flow Designer. Add the target name of a single service you want to notify when the change is received to the end of the URL.
- For URL authentication, use an ampersand to attach the service. For example, if you want to notify the Cassiopeia Service, you'd add &recipients=Cassiopeia%20Service to the URL.
- For other authentication types, use a question mark to attach the service. For example, if you want to notify the Antares Service, you'd add ?recipients=Antares%20Service to the URL.
- You must URL-encode any special characters or spaces in the target names.
- Optional: If you chose to use Basic Authentication, fill in your username and password in the Basic authentication username and Basic authentication password fields.
- HTTP headers: Leave blank.
- Resource details to send: All
- Messages to send: All
- Detailed messages to send: All
- Resource Version: 1.0
- URL: Paste the trigger URL you copied from Flow Designer. Add the target name of a single service you want to notify when the change is received to the end of the URL.
- Click Test if you want to test service hook you just configured.
- Click Finish.
You're ready to use the webhook to trigger automated flows, including steps such as sending alerts and initiating incidents, though we always recommend testing before putting things into use.
Set the impacted or associated service
To set a recipient from this webhook, add the name of a single impacted or associated service to the end of the trigger URL in Azure Pipelines. The encoding used to add the service is based on the type of authentication you select in Flow Designer.
- For URL authentication, use an ampersand to attach the service. For example, if you want to notify the Cassiopeia Service, you'd add &recipients=Cassiopeia%20Service to the URL.
- For other authentication types, use a question mark to attach the service. For example, if you want to notify the Antares Service, you'd add ?recipients=Antares%20Service to the URL.
Remember to URL-encode any special characters or spaces in the service's target name.
After setting the recipient on the Azure Pipelines webhook, go to Flow Designer and open the Change Record step. Drag and drop the Recipients variable into the Associated Service field. When changes are received, the associated or impacted service is notified of the change.
You can also manually add a service by typing its name into the Associated Service field.
Next Steps
Now that you've installed the workflow, you can use it as-is, or customize it to suit your needs better. Here are some examples of things you can add to the workflow to customize it:
- Use Slack, Zoom, and Microsoft Teams steps to add collaboration channels to the flow.
- Add a Create Alert step to notify recipients of the change.
- Update the message sent to resolvers to include the information most relevant to your team.
- Use the Azure Pipelines Events trigger to build your own custom flows.