Shravan Kumar Kasagoni

Skip Navigation
Continuous Deployment from Source Control to Windows Azure Web Sites using Local Git Repository

Continuous Deployment from Source Control to Windows Azure Web Sites using Local Git Repository

 /  3 responses

This is the third article in series of Windows Azure Web Sites, In this article I am going to discuss about continuous deployment from source control to windows azure web sites using local git repository.

Windows Azure Web Sites supports continuous deployment from source control and repository tools like Team Foundation Service, CodePlex, GitHub, Dropbox, Bitbucket, External Repository(Git, Mercurial), and Local Git Repository.

In this article we are going to publish our local Git repository to a remote repository in Windows Azure, and our site will go live quickly and automatically.

Let’s create a Web Site on Windows Azure. Refer to the following article for steps to create a web site on Windows Azure: Creating & Publishing a Hello World application on Windows Azure Web Sites

  • Login to https://manage.windowsazure.com, then go to bottom left corner of portal, we will find a  NEW button, click on it.
  • Once you click on QUICK CREATE, It will show a textbox for entering the URL (all the website URLS’s on azure ends with “.azurewebsites.net”) of the web site & dropdown for choosing REGION for creating web site.
  • Once you enter the details click on CREATE WEB SITE. With in few seconds a web site will be created & running on Azure.
  • Now our web site is now ready on Azure, let’s enable source control integration on the site.
  • Go to DASHBOARD => quick glance => click on “Set up deployment from source control
quick glance
  • It will show the “SET UP DEPLOYMENT” pop up.
  • Select the “Local Git Repository” then click on next arrow. This step will enable Git repository on our Windows Azure site.
setup
gitready
  • For this demo I am going to take the help of WebMatrix for creating a coffee shop site.
  • Go to WebMatrix, in the Quick Start page click on New then select “Template Gallery” => select ASP.NET => select Bakery => click on Next => It will create a bakery site in WebMatrix.
webmatrix
site template
coffeeshop
  • Now click on Run button.
site
  • Open the Git Shell (We need Git software for this demo, I have already installed in my machine)
  • In  Git Shell, go to folder where our coffee site is created.
  • Initialize the git using “git Init” command
  • Add all the files & folders in current folder to local git repository using “git add
git1
  • Commit all the files to local repository (git commit –m “initial commit”)
git2
  • Add remote Windows Azure repository
  • Push the local repository to Windows Azure repository
git3
  • All the local stuff is published to Windows Azure repository & site is deployed on Azure Web Site.
azuresite1
  • Let’s look at the DEPLOYMENTS tab in Windows Azure portal, we can see one active deployment.
portal
  • Now make some changes & push the site again, for demo I am going to change the “Welcome to Fourth Coffee!” to “Welcome to Fourth Coffee Shop!” in Default.cshtml
  • Repeat above steps to push the site again (avoid git init, no need to initialize this time, no need to add remote repo)
git4
azuresite2
  • Once again look at the DEPLOYMENTS tab in Windows Azure portal, we can see two deployments & one active deployment.
portal1
  • If we select any of the previous deployments, we will see a REDEPLOY button, using it we can publish any version of the site
  • Let’s publish the previous version of the site, hit the REDEPLOY button , azure will ask for conformation say yes
sayyes
portal3
sitelast

This is the quick overview of continuous deployment from source control to windows azure web sites using local git repository, here are the links for remaining article in the series.

Write a response

Your email address will not be published. Required fields are marked *

All code will be displayed literally.

Discussion