How-to: Integrate MS Teams

Integrate Microsoft Teams with HCL DevOps Deploy (Deploy) to post notifications automatically to your Teams channel whenever a specific deployment event happens.

Before you begin

About this task

By using the Incoming Webhook connector in Teams, you can integrate Deploy services so that you get notified of an event through the Teams channels.

In this example, you will learn about the requirements and procedures to integrate Teams with Deploy. To integrate Teams with Deploy, follow the steps provided in this section.

Step 1: Format the message card

A message card is defined in a JSON format that includes the message in text, links, and image, if required. For HCL DevOps Deploy (Deploy), you can create a message card that refers to the process name, status, and a link to the process deployment page. The message card format is used as body in the webhook template.

About this task

The message cards can be created using the following available templates:

Step 2: Create a webhook template

Create a webhook template for an event so that when the event happens a notification is triggered on Teams.

Procedure

  1. Select Settings > Webhook Templates > Create Webhook Template.
  2. Provide a name and description for the template. For this example, give the name as Process failure notification.
  3. Click on Body area and paste the example code from the step 1.
  4. Choose the event type Process Failure from the Type field.
  5. Submit your changes.

Results

The webhook template is created and ready to be added to an application.

Step 3: Add webhook template to an application

You can add a webhook template to applications, generic processes, and external approval processes. For this example, you add the template to an application.

Before you begin

Make sure that you created an environment for the application and have resources added to it.

Procedure

  1. Select Applications > application name > Configuration > Webhooks > Add Webhook.
    The Add Webhook window is displayed.
  2. Copy the webhook URL and paste into the URL field.
  3. Specify proxy host and port if you are using a proxy server for Teams.
  4. Specify the event type as Process Failure.
  5. Select the template name that you created in step 3 from the Webhook Template field.
  6. Specify the environment name in the Environments field.
  7. Submit your changes.

Results

The webhook template is added to the application. When an application process run on the environment and fails, the Teams channel shows the following example notification.
Webhook-Integration-Test 6/13 6:53 PM
An approval failed for the App application on the Env environment
An application process was rejected during its approval process
Application: App Environment: Env Requested by: admin Scheduled for: Sun Jun 13 18:52:31 IST 2021 Description: ${request.Description}
Click View Details for more information.