Introduction
Azure Web Apps have a great feature: continuous deployment from different kinds of repositories: Visual Studio Online, OneDrive, a local Git repo, GitHub, Bitbucket, Dropbox or an external repo. You also have built-in alert notifications, but there’s no built-in notifications for deployments, and that’s where Kudu web hooks come to the rescue.
But first, what is Kudu?
Project Kudu is an open source project hosted in GitHub that is the engine behind Git/Mercurial deployments, WebJobs, and various other features in Azure Web Apps. And, it can also run outside of Azure.
What are Web Hooks?
A Web Hook is an HTTP callback: an HTTP POST that occurs when something happens; a simple event-notification via HTTP POST. Web Hooks are a way to receive valuable information when it happens, rather than continually polling for that data and receiving nothing valuable most of the time.
How do we integrate?
At Nubimetrics, like many other startups, we use Slack as our team communications platform. Slack offers integration with other apps and services like GitHub, Bitbucket, Trello, Asana, JIRA, Google+ Hangouts, Google Drive, Dropbox and Visual Studio Online, just to name a few (if you are interested in all integration options visit https://slack.com/integrations).
As you can see, we have no built-in integration with Kudu, but web hooks come to the rescue again! Slack supports incoming web hooks as a way for other apps to to post messages into Slack.
And, to make things easier, there’s an already built app hosted in GitHub, that is written in Node.js and runs on Azure.
All we need to do is:
- Go to our Slack team configuration and set up an incoming webhook integration.
- Deploy the app from the deploy button.
- Configure an environment variable named
slackhookuri
with the value of the URI from Step 1. - Add the URI to your Azure web app Kudu portal web hooks, you reach it via
https://{your azure web app}.scm.azurewebsites.net/WebHooks
- And that’s it!!
Conclusion
Web hooks provide us an easy way of integrating web applications. Using simple web requests with a JSON payload we can integrate almost anything!
Happy coding!
Hi, nice post, just to be aware that the URI to be entered at the webhook value at site’s scm configuration should be the URI of the Kudu web app published from Git. Cheers.
LikeLike
https://waterfallmagazine.com
You could certainly see your skills within the work you write.
The world hopes for even more passionate writers like
you who are not afraid to say how they believe.
Always go after your heart.
LikeLike
Veryy thoughtful blog
LikeLike