Link Gitlab and Microsoft Teams using connectors
In application development, often multiple developers or a whole team is involved. And when multiple individuals are working on a same project, there are chances of miscommunication and code conflict. We often need to check and track on who’s checking on which part of code and what changes are being made. In my company, we use Microsoft Teams for communication and Gitlab for code repository. Link Gitlab and Microsoft teams using connectors and get notified about the changes on codebase would be a great tool for my internal project management.
In my previous company, we used Slack for team communication and Gitlab for code repository. We had used Slack Notifications Service to push notifications from Gitlab projects to Slack. So I was looking for similar solution with Gitlab and Microsoft Teams, where I get notified about the changes on our codebase. Here is how I did it.
Link Gitlab and Microsoft Teams
MS Teams setup
- Create new Team or find your existing Team
- Create new channel or may use existing channel if you have already have one
- Find “…” next to Team channel name and click on it
- Select Connectors under “…” menu
- Search for “Incoming Webhooks” and click on “Add” button next to it
- Then click on “Add” button following window.
- As I’m working on Ubuntu Linux machine, the following Step 7 and 8 might not be needed on Teams for Windows or MAC
- Then again, click on “…” next to Team name and select “Connectors” from the menu
- Find “Incoming Webhooks” under Connector for your team and click on “Configure” button.
- Give a name for the connector, add an image if you want, then click on “Create” button.
- Now, you should receive a notification in your Teams channel from the name you just gave to connector, to confirm your connector has been setup successfully.
- Then scroll down to URl field and copy it. We will use this webhook url in Gitlab.
- Go to your project repo in Gitlab
- Go to Settings > Integrations
- Scroll down to find Microsoft teams notifications and click it
- Select all the checkboxes you wish to receive notification for and paste webhook url we copied from MS Teams to webhook field
- Check “Active” checkbox to enable integration
- Finally, save the changes
That’s it! You should now receive notification in your Teams channel when you check in or change files in project repository.