Shipa Blog

Latest updates on our products, plus helpful articles relating to Kubernetes, container security, microservices and more

Your First Shipa Webhook – Microsoft Teams Integration

One more “ops” phoneme like DevOps is ChatOps; or conversation-based development/operations. ChatOps has been growing in popularity as communication platforms such as Slack is ingrained in our day-to-day engineering lives. A team lead once told me “if it didn’t happen in Slack, it didn’t happen” showing the emphasis of communication platforms as a system of record. 

As Microsoft Lync and Skype continued to evolve, Microsoft Teams is a more recent creation in the enterprise communication ecosystem. As of this blog, Shipa does not have a native integration with Microsoft Teams yet. Though in this example, one can learn how to integrate Shipa with a multitude of external systems using a webhook. There is a lot of the art of the possible with the Shipa Webhooks

Getting Started

The moving pieces in this example are Shipa Cloud, the Shipa CLI, and Microsoft Teams. If you have not already, sign up for Shipa Cloud account. 

Shipa Cloud

Assuming that you have a workload deployed to Shipa or Shipa Cloud, this webhook example will pick up there. If you need to wire Shipa or Shipa Cloud to a Kubernetes cluster, a previous example will get you from zero to hero. 

Shipa CLI

We will be leveraging the Shipa CLI to create the webhook. Installing the CLI and pointing to Shipa Cloud is simple. 

curl -s | bash
shipa target add shipa-cloud --set-current
shipa login
shipa version
Shipa Cloud CLI

Microsoft Teams

The integration with Microsoft Teams will use the Incoming Webhook Teams Application. If you do not have the App installed, you can launch Microsoft Teams then click on Apps and search for “webhook” then select Incoming Webhook

Microsoft Teams Install Incoming Webhook

Once installed, you can configure the Incoming Webhook on a Channel of your choice. 

Connect Teams Webhook

Then select Incoming Webhook to configure.

Attach Microsoft Webhook

Click Configure. Set a name such as “shipa-alerts” then click Create. Your webhook endpoint will be created. Make sure to copy the endpoint URL to reference. 

Configure Webhook

Now you are ready to configure a Shipa Webhook.

Creating a Shipa Webhook

Leveraging the Shipa CLI, you can create a webhook hired to the incoming webhook in Microsoft Teams. The Shipa Documentation has an excellent example of how to formulate a webhook on an Application deployment. 

Here is a sample command that takes into account the default team [shipa-team] in your Shipa Cloud Account and will send off a webhook event on an Application deployment. 

shipa event webhook create somewebhook <A Webhook Address> -d "Some Description" -t some-team -m POST -H Content-Type=application/json -b '{"text": "Body of Text to Send can have {{.Some.Variable}}"}' --kind-name some.event

e.g for “app.deploys”

shipa event webhook create msteams****** -d "Application Deployments" -t shipa-team -m POST -H Content-Type=application/json -b '{"text": "{{.Kind.Name}}: {{.Target.Type}} {{.Target.Value}}"}' --kind-name app.deploy

Add Shipa Webhok

With the webhook registered, now you can test out the webhook. 

In Shipa, you can deploy or re-deploy an application to validate that webhook was triggered. 

Shipa Cloud -> Applications -> your_app -> Deploy

Deploy Shipa App

Once you hit Submit, head back to Microsoft Teams and see your message!

Shipa Microsoft Team Message

With that, your first Shipa Integration is complete. There is certainly a lot of the art of the possible with integrating systems and processes with Shipa. We are curious to hear how you want to integrate or are integrating with Shipa. Feel free to join our Slack Workspace to chat with us.