Stay up to date on your build activities with Jenkins integration in Microsoft Teams
Published Apr 17 2019 10:08 AM 71.3K Views
Microsoft

During my conversations with customers I usually get asked if Microsoft Teams support Jenkins, what all Jenkins notifications can be configured in teams and how does Jenkins notifications look in Teams. So, I decided to write up this article to explain how to configure Jenkins notifications in Teams.

 

Jenkins is one of the leading open-source continuous integration tool used for staying up to date on build related activities. Microsoft Teams is growing in DevOps space with over 60+ DevOps apps in its app store. Using both of these great software tools together have potential to bring efficiencies in your build workflow by keeping you always up to date on your build activities.

 

Jenkins connector in Microsoft Teams sends notification about build-related activities to whichever channel the connector is configured. Below is the list of build activities that you can be notified against:

  • Build Start
  • Build Aborted
  • Build Failure
  • Build Not Built
  • Build Success
  • Build Unstable
  • Back To Normal
  • Repeated Failure

 

Adding Jenkins Connector in Teams

Go to connectors gallery by clicking ‘…’ next to the channel name. Add Jenkins connector and once the connector is installed, name the connector according to your needs and once the notifications are generated, you’ll see them coming from the Jenkins connector you just named.

 

Jenkins_ConfigureTeams.png

 

Copy the webhook url shown on the config experience page as you would need to enter this webhook url on Jenkins portal to configure your build notifications.

 

Configuring webhook in Jenkins

‘Office 365 Connector’ on the Jenkins portal needs to installed if not installed already. To install the connector go to ‘Manage Jenkins’  -> ‘Manage Plugins’ -> ‘Available’ section. Select and install ‘Office 365 Connector’ from the list. While installing the connector select ‘Install without restart’ option.

 

Once the connector is installed, setup the webhook copied from Microsoft Teams to start getting the notifications in the channel. Go to the Jenkins project you created and go to ‘Configure’ section. Once in ‘Configure’ view, go to ‘Office 365 Connector’ section and ‘Add Webhook’. Paste the URL copied from Microsoft Team, name your webhook and go to ‘Advanced’ section for the webhook and check all the notification boxes for which you want to receive events and save the webhook.

 

Jenkins_Webhook_NotificationSelection.jpg

 

Now whenever you kick off the build, you’ll see notifications in the Teams channel based what notifications you have configured. Below is the example of Jenkins notifications once received in Teams channel

 

Jenkins_BuildNotification.png

 

24 Comments
Iron Contributor

So just to confirm, no authentication needs to be configured in order to allow ANY Jenkins instance to write to Teams?  The URL is specific enough to uniquely identify the Teams instance and channel so permissions are are automatically implied by having the webhook URL?

Microsoft

@Bruce Weatherford, that's correct. URL will let the notifications flow in Teams and the specific channel. 

Copper Contributor

Is there a way to obfiscate secrets like password in case someone tries to pass that as part of the message similar to how Jenkins log itself does it if you try to print some password on the log output.

Copper Contributor

This Connector seams to stop working for us on 07-11-2019 and we don't know why. 

Tried to get more information with this curl call: curl -H "Content-Type: application/json" -d "{\"text\": \"Hello World!\"}" <YOUR WEBHOOK URL>

Unfortunately, the answer is: Webhook message delivery failed with error: Microsoft Teams endWebhook message delivery failed with error: Microsoft Teams endpoint returned HTTP error 403 with ContextId

Was there anything changed on MS side at this date?

 

UPDATE: was an internal problem - now fixed. And we use the Incoming webhook.

Copper Contributor

For the future generations there is no "Jenkins connector" in MS Teams. You need to choose: Incoming Webhook

Copper Contributor

hi @Amit Oberoi ,

 

Is it possible to configure Office 365 jenkins plugin globally in jenkins instead of individual project?

 

Regards

SabySan

Copper Contributor

Currently on Microsoft teams, when I clicked connectors  option in channel settings, there was no option available for Jenkins notification Web-hook. Help me on this.

Microsoft

@Zeeshan_Ali please confirm with your Teams admin that the Jenkins connector has not been disabled for your organization. 

Copper Contributor

Incoming webhook security is big risk https://microsoftteams.uservoice.com/forums/555103-public/suggestions/32521762-incoming-webhook-secu...

 

You can easily blast messages from outside of your organization 

Copper Contributor

We are trying to send notifications from Jenkins to MS Teams. Able to successfully send notifications via command line (using curl command) but not able to send via Jenkins plugin. We are not getting any error, but the notifications are not received at Teams end. 

Can someone provide a possible solution to address this issue please? 
- Raghav

Microsoft

@raghvenk please reach out to Microsoft Teams support to help troubleshoot this issue. 

Copper Contributor

@ErinBailie @Thank you :thumbs_up:

Copper Contributor

Hi Team,

 

I am unable to find Jenkins in teams connectors, Can anyone help regarding notification with teams and jenkins

 

 

Thanks,

Saikrishna

Microsoft

@saikrishna17 Please confirm with your tenant administrator that 3P applications have been enabled for your tenant, and you are permitted to configure connectors for the channels you're trying to configure. Hope this helps!

Copper Contributor

@ErinBailie  Thanks for your update

 

Copper Contributor

We are also looking up this app - but I would like to know if there are any plans to make it bidirectionnal ? we would also want to send commands to Jenkins from Teams. We are currently trying outgoing web hook, without success up to now. So if you have any recommendations, please let me know.

 

Thanks,

JF

Copper Contributor

Hi @Amit Oberoi @ErinBailie 

Is it possible to configure Office 365 Jenkins plugin globally in Jenkins instead of individual projects?

It will bee helpful if you can share a tip on how to connect the plugin once and all Jenkins projects in one Jenkins server will have the ability to report any build status I am interested in?

 

Thank you,

Copper Contributor

Can you somehow send Mails instead of MS Teams notifications with the Office 365 Connector? or at least forward the MS Teams notification as a mail.

Copper Contributor

Hi, does anyone know if you can receive notifications with the Office 365 Connector in a specific teams Chat instead of a channel?

Copper Contributor

I want the job to notify the channel using " @channel " command incase of a job failure on jenkins. That way there would be a notification to all the Team members about the failure. 

 

Has anyone done this ? Any help on is appreciated.

Copper Contributor

Hi, does anyone know if you can receive notifications with the Office 365 Connector in a specific teams Chat instead of a channel?

Microsoft

@michaelbassi - the Jenkins Connector works in a channel context. Microsoft Teams doesn't support group chat connectors.

Copper Contributor

Hello there, I'm stuck at the very first step. Can you tell me what are the prerequisites for having something displayed in the connector ?

I guess we have a configuration issue but I do not see where. 
When I click on (...) and then select connectors

lmo34_0-1628894977517.png

A blank page appears :

lmo34_1-1628895230485.png

 

In Microsoft Teams admin center I do not see anything related to connectors.

Everything is "On" nothing "Off" for Apps

lmo34_2-1628895383993.png
 
lmo34_3-1628895432612.png

 

lmo34_5-1628895747720.png

 

lmo34_6-1628895832161.png

 

 
Copper Contributor

Is it possible to send messages to a group chat that is not inside of a team?

Version history
Last update:
‎Jan 26 2021 01:16 PM
Updated by: