Home
%3CLINGO-SUB%20id%3D%22lingo-sub-467440%22%20slang%3D%22en-US%22%3EStay%20up%20to%20date%20on%20your%20build%20activities%20with%20Jenkins%20integration%20in%20Microsoft%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-467440%22%20slang%3D%22en-US%22%3E%3CP%20style%3D%22text-align%3A%20justify%3B%22%3EDuring%20my%20conversations%20with%20customers%20I%20usually%20get%20asked%20if%20Microsoft%20Teams%20support%20Jenkins%2C%20what%20all%20Jenkins%20notifications%20can%20be%20configured%20in%20teams%20and%20how%20does%20Jenkins%20notifications%20look%20in%20Teams.%20So%2C%20I%20decided%20to%20write%20up%20this%20article%20to%20explain%20how%20to%20configure%20Jenkins%20notifications%20in%20Teams.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22text-align%3A%20justify%3B%22%3EJenkins%20is%20one%20of%20the%20leading%20open-source%20continuous%20integration%20tool%20used%20for%20staying%20up%20to%20date%20on%20build%20related%20activities.%20Microsoft%20Teams%20is%20growing%20in%20DevOps%20space%20with%20over%2060%2B%20DevOps%20apps%20in%20its%20app%20store.%20Using%20both%20of%20these%20great%20software%20tools%20together%20have%20potential%20to%20bring%20efficiencies%20in%20your%20build%20workflow%20by%20keeping%20you%20always%20up%20to%20date%20on%20your%20build%20activities.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22text-align%3A%20justify%3B%22%3EJenkins%20connector%20in%20Microsoft%20Teams%20sends%20notification%20about%20build-related%20activities%20to%20whichever%20channel%20the%20connector%20is%20configured.%20Below%20is%20the%20list%20of%20build%20activities%20that%20you%20can%20be%20notified%20against%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EBuild%20Start%3C%2FLI%3E%0A%3CLI%3EBuild%20Aborted%3C%2FLI%3E%0A%3CLI%3EBuild%20Failure%3C%2FLI%3E%0A%3CLI%3EBuild%20Not%20Built%3C%2FLI%3E%0A%3CLI%3EBuild%20Success%3C%2FLI%3E%0A%3CLI%3EBuild%20Unstable%3C%2FLI%3E%0A%3CLI%3EBack%20To%20Normal%3C%2FLI%3E%0A%3CLI%3ERepeated%20Failure%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EAdding%20Jenkins%20Connector%20in%20Teams%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%20style%3D%22text-align%3A%20justify%3B%22%3EGo%20to%20connectors%20gallery%20by%20clicking%20%E2%80%98%E2%80%A6%E2%80%99%20next%20to%20the%20channel%20name.%20Add%20Jenkins%20connector%20and%20once%20the%20connector%20is%20installed%2C%20name%20the%20connector%20according%20to%20your%20needs%20and%20once%20the%20notifications%20are%20generated%2C%20you%E2%80%99ll%20see%20them%20coming%20from%20the%20Jenkins%20connector%20you%20just%20named.%3C%2FP%3E%0A%3CP%20style%3D%22text-align%3A%20justify%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22text-align%3A%20justify%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F109350i604BEF6F06BB5C00%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Jenkins_ConfigureTeams.png%22%20title%3D%22Jenkins_ConfigureTeams.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECopy%20the%20webhook%20url%20shown%20on%20the%20config%20experience%20page%20as%20you%20would%20need%20to%20enter%20this%20webhook%20url%20on%20Jenkins%20portal%20to%20configure%20your%20build%20notifications.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EConfiguring%20webhook%20in%20Jenkins%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%20style%3D%22text-align%3A%20justify%3B%22%3E%E2%80%98Office%20365%20Connector%E2%80%99%20on%20the%20Jenkins%20portal%20needs%20to%20installed%20if%20not%20installed%20already.%20To%20install%20the%20connector%20go%20to%20%E2%80%98Manage%20Jenkins%E2%80%99%20%26nbsp%3B-%26gt%3B%20%E2%80%98Manage%20Plugins%E2%80%99%20-%26gt%3B%20%E2%80%98Available%E2%80%99%20section.%20Select%20and%20install%20%E2%80%98Office%20365%20Connector%E2%80%99%20from%20the%20list.%20While%20installing%20the%20connector%20select%20%E2%80%98Install%20without%20restart%E2%80%99%20option.%3C%2FP%3E%0A%3CP%20style%3D%22text-align%3A%20justify%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22text-align%3A%20justify%3B%22%3EOnce%20the%20connector%20is%20installed%2C%20setup%20the%20webhook%20copied%20from%20Microsoft%20Teams%20to%20start%20getting%20the%20notifications%20in%20the%20channel.%20Go%20to%20the%20Jenkins%20project%20you%20created%20and%20go%20to%20%E2%80%98Configure%E2%80%99%20section.%20Once%20in%20%E2%80%98Configure%E2%80%99%20view%2C%20go%20to%20%E2%80%98Office%20365%20Connector%E2%80%99%20section%20and%20%E2%80%98Add%20Webhook%E2%80%99.%20Paste%20the%20URL%20copied%20from%20Microsoft%20Team%2C%20name%20your%20webhook%20and%20go%20to%20%E2%80%98Advanced%E2%80%99%20section%20for%20the%20webhook%20and%20check%20all%20the%20notification%20boxes%20for%20which%20you%20want%20to%20receive%20events%20and%20save%20the%20webhook.%3C%2FP%3E%0A%3CP%20style%3D%22text-align%3A%20justify%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22text-align%3A%20justify%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F109351iF50F57B17D629A01%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Jenkins_Webhook_NotificationSelection.jpg%22%20title%3D%22Jenkins_Webhook_NotificationSelection.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20whenever%20you%20kick%20off%20the%20build%2C%20you%E2%80%99ll%20see%20notifications%20in%20the%20Teams%20channel%20based%20what%20notifications%20you%20have%20configured.%20Below%20is%20the%20example%20of%20Jenkins%20notifications%20once%20received%20in%20Teams%20channel%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F109352iB4CB086C07FC5A22%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Jenkins_BuildNotification.png%22%20title%3D%22Jenkins_BuildNotification.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-467440%22%20slang%3D%22en-US%22%3E%3CP%3EGet%20your%20Jenkins%20build%20notifications%20in%20Microsoft%20Teams%2C%20your%20hub%20for%20Teamwork!%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-467440%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-478363%22%20slang%3D%22en-US%22%3ERe%3A%20Stay%20up%20to%20date%20on%20your%20build%20activities%20with%20Jenkins%20integration%20in%20Microsoft%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-478363%22%20slang%3D%22en-US%22%3E%3CP%3ESo%20just%20to%20confirm%2C%20no%20authentication%20needs%20to%20be%20configured%20in%20order%20to%20allow%20ANY%20Jenkins%20instance%20to%20write%20to%20Teams%3F%26nbsp%3B%20The%20URL%20is%20specific%20enough%20to%20uniquely%20identify%20the%20Teams%20instance%20and%20channel%20so%20permissions%20are%20are%20automatically%20implied%20by%20having%20the%20webhook%20URL%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-657068%22%20slang%3D%22en-US%22%3ERe%3A%20Stay%20up%20to%20date%20on%20your%20build%20activities%20with%20Jenkins%20integration%20in%20Microsoft%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-657068%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F73058%22%20target%3D%22_blank%22%3E%40Bruce%20Weatherford%3C%2FA%3E%2C%20that's%20correct.%20URL%20will%20let%20the%20notifications%20flow%20in%20Teams%20and%20the%20specific%20channel.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-745254%22%20slang%3D%22en-US%22%3ERe%3A%20Stay%20up%20to%20date%20on%20your%20build%20activities%20with%20Jenkins%20integration%20in%20Microsoft%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-745254%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20there%20a%20way%20to%20obfiscate%20secrets%20like%20password%20in%20case%20someone%20tries%20to%20pass%20that%20as%20part%20of%20the%20message%20similar%20to%20how%20Jenkins%20log%20itself%20does%20it%20if%20you%20try%20to%20print%20some%20password%20on%20the%20log%20output.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-759005%22%20slang%3D%22en-US%22%3ERe%3A%20Stay%20up%20to%20date%20on%20your%20build%20activities%20with%20Jenkins%20integration%20in%20Microsoft%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-759005%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20Connector%20seams%20to%20stop%20working%20for%20us%20on%2007-11-2019%20and%20we%20don't%20know%20why.%26nbsp%3B%3C%2FP%3E%3CP%3ETried%20to%20get%20more%20information%20with%20this%20curl%20call%3A%26nbsp%3Bcurl%20-H%20%22Content-Type%3A%20application%2Fjson%22%20-d%20%22%7B%5C%22text%5C%22%3A%20%5C%22Hello%20World!%5C%22%7D%22%20%3CYOUR%20webhook%3D%22%22%20url%3D%22%22%3E%3C%2FYOUR%3E%3C%2FP%3E%3CP%3EUnfortunately%2C%20the%20answer%20is%3A%26nbsp%3B%3CSPAN%20class%3D%22s1%22%3EWebhook%20message%20delivery%20failed%20with%20error%3A%20Microsoft%20Teams%20endWebhook%20message%20delivery%20failed%20with%20error%3A%20Microsoft%20Teams%20endpoint%20returned%20HTTP%20error%20403%20with%20ContextId%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22s1%22%3EWas%20there%20anything%20changed%20on%20MS%20side%20at%20this%20date%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
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

 

4 Comments
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. 

Regular Visitor

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.

Occasional Visitor

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?