Continuous Integration and Continuous Delivery 

Continuous Integration (CI) is central process of most agile development today. CI comes out as a way of reducing code integration issues. The best part of CI is do code integrations frequently rather than doing all at once, which helps us fix the integration problems early and deliver the artifacts on time. So CI is meant for developer working copies are synced to repositories several times in a day.

Continuous Deployment is also a development practice where the successful builds are moved to production.

Microsoft Azure comes up with several options where we can deploy our sites right from TFS/Git when we do check-in. This article is mainly focusing on Azure website deployment using KUDU.

Why KUDU

It’s a deployment framework that gets triggered by git. It is similar to VSOnline where you check-in the code, a build definition was created which will build the code and run all your unit tests and the result (Success) of this process gets pushed to azure websites. In case of failure we can use Webhooks to perform any custom action like notify a user by way of email/sms etc. We will discuss more on Webhooks in another article.

Apart from continuous deployment KUDU also helps us in getting the control over hosted websites. One of the main concerns of the people today who are using hosted solutions like azure websites are having lack of control?

Lack of control in terms of

Where the website was hosted?

What is the processor and memory capacity?

How many different processes are running on the machine?

What is the underlying file system?

What are the environment variables are present at that System? So on so forth…

Solution is KUDU, It’s a crazy nameJ. It is an open source.

How KUDU Works

When you create an azure website a companion site is also created along with that. Suppose you create a website like KuduDemo then {WebsiteName}.scm.azurewebsites.net site will created. This service will run under the context of the website and have same access control like the website. It helps us to manage the deployment and configuration of the site. The following diagram depicts how KUDU works

KuduPart_1

Note: To do this process we need to set up a deployment credentials which will be linked to azure subscription account.

  • User has local git repo.
  • Pushing the changes to the remote github.
  • A post notification triggered by git (Login to hit hub, Go to the repository, Settings, Webhooks and Services and see the Webhooks url). This is nothing but calling a callback to an azure website.
  • Azure website pull the changes and start the deployment process.
  • Go to the Azure website, Deployments under which we can see the Deployment history, Author and Deployed by: GitHub etc

KUDU Features

Kudu has several features like

  • Environment under which website is running
  • REST APIs for seeing AppSettings/Webhooks/SiteExtensions etc
  • Process Explorer to see various processes running.
  • Debug Console command line interface to perform different actions like edit/remove/add files. We can view the log files as well. Both Command line and Power shell capabilities are available.
  • Site Extensions helps us to add more tooling support to the existing framework.

 

KuduPart_1.1

Conclusion

So KUDU is a Service Control Manager for Azure web sites. It is the deployment F/W used by Git. It is really simple to view/edit and remove files from your Web Application. The beauty of the service is it can enable us to view the log files and customize the deployment script as well.