Shaun Xu

The Sheep-Pen of the Shaun


News

logo

Shaun, the author of this blog is a semi-geek, clumsy developer, passionate speaker and incapable architect with about 10 years experience in .NET. He hopes to prove that software development is art rather than manufacturing. He's into cloud computing platform and technologies (Windows Azure, Aliyun) as well as WCF and ASP.NET MVC. Recently he's falling in love with JavaScript and Node.js.

Currently Shaun is working at IGT Technology Development (Beijing) Co., Ltd. as the architect responsible for product framework design and development.

MVP

My Stats

  • Posts - 97
  • Comments - 348
  • Trackbacks - 0

Tag Cloud


Recent Comments


Recent Posts


Archives


Post Categories



Microsoft had just announced an update for Windows Azure Web Site (a.k.a. WAWS). There are four major features added in WAWS which are free scaling mode, GitHub integration, custom domain and multi branches.

Since I ‘m working in Node.js and I would like to have my code in GitHub and deployed automatically to my Windows Azure Web Site once I sync my code, this feature is a big good news to me.

 

It’s very simple to establish the GitHub integration in WAWS. First we need a clean WAWS. In its dashboard page click “Set up Git publishing”.

image

Currently WAWS doesn’t support to change the publish setting. So if you have an existing WAWS which published by TFS or local Git then you have to create a new WAWS and set the Git publishing.

Then in the deployment page we can see now WAWS supports three Git publishing modes:

- Push my local files to Windows Azure: In this mode we will create a new Git repository on local machine and commit, publish our code to Windows Azure through Git command or some GUI.

- Deploy from my GitHub project: In this mode we will have a Git repository created on GitHub. Once we publish our code to GitHub Windows Azure will download the code and trigger a new deployment.

- Deploy from my CodePlex project: Similar as the previous one but our code would be in CodePlex repository.

 

Now let’s back to GitHub and create a new publish repository.

Currently WAWS GitHub integration only support for public repositories. The private repositories support will be available in several weeks.

We can manage our repositories in GitHub website. But as a windows geek I prefer the GUI tool. So I opened the GitHub for Windows, login with my GitHub account and select the “github” category, click the “add” button to create a new repository on GitHub.

image

You can download the GitHub for Windows here.

I specified the repository name, description, local repository, do not check the “Keep this code private”. After few seconds it will create a new repository on GitHub and associate it to my local machine in that folder.

image

We can find this new repository in GitHub website. And in GitHub for Windows we can also find the local repository by selecting the “local” category.

image

 

Next, we need to associate this repository with our WAWS. Back to windows developer portal, open the “Deploy from my GitHub project” in the deployment page and click the “Authorize Windows Azure” link. It will bring up a new windows on GitHub which let me allow the Windows Azure application can access your repositories.

image

After we clicked “Allow”, windows azure will retrieve all my GitHub public repositories and let me select which one I want to integrate to this WAWS. I selected the one I had just created in GitHub for Windows.

image

So that’s all. We had completed the GitHub integration configuration. Now let’s have a try. In GitHub for Windows, right click on this local repository and click “open in explorer”. Then I added a simple HTML file.

   1: <html>
   2:     <head>
   3:     </head>
   4:     <body>
   5:         <h1>
   6:             I came from GitHub, WOW!
   7:         </h1>
   8:     </body>
   9: </html>

Save it and back to GitHub for Windows, commit this change and publish. This will upload our changes to GitHub, and Windows Azure will detect this update and trigger a new deployment.

If we went back to azure developer portal we can find the new deployment. And our commit message will be shown as the deployment description as well.

image

And here is the page deployed to WAWS.

image

 

Hope this helps,

Shaun

All documents and related graphics, codes are provided "AS IS" without warranty of any kind.
Copyright © Shaun Ziyan Xu. This work is licensed under the Creative Commons License.

Comments

Gravatar # re: GitHub Integration in Windows Azure Web Site
Posted by Garden Maintenance Kent on 9/24/2012 8:11 PM
Thanks for sharing.
Gravatar # re: GitHub Integration in Windows Azure Web Site
Posted by Bart on 9/25/2012 10:00 PM
Shaun, do you know if this should work for private repositories on Github? I can only select one of the public repositories in Azure.

Grtz,

Bart
Gravatar # re: GitHub Integration in Windows Azure Web Site
Posted by Shaun on 9/26/2012 10:00 AM
@Bart, as I mentioned in the middle of the post, "Currently WAWS GitHub integration only support for public repositories. The private repositories support will be available in several weeks."
Gravatar # re: GitHub Integration in Windows Azure Web Site
Posted by Bart on 9/26/2012 2:48 PM
@Shaun I missed that part apparently. I already got a response from David Ebbo at Microsoft: Not yet, but we are going to support this in the next update. Exact date is TBD, but hopefully in the next month or so.

Thx for helping out.
Gravatar # re: GitHub Integration in Windows Azure Web Site
Posted by Stephen Davidson on 3/9/2013 1:26 AM
Great post...I have this almost working...in that my GitHub repo was already full of content but cannot for the life me work out how to do a deply on existing files?!
Gravatar # re: GitHub Integration in Windows Azure Web Site
Posted by Mohit Sharma on 6/10/2013 12:56 PM
I connect to github successfully, but when i browse my website its give a error tht you not have permission to view repository or page.
please give me some suggestions how to remove it??
Gravatar # re: GitHub Integration in Windows Azure Web Site
Posted by Mohit Sharma on 6/10/2013 1:00 PM
When i browse my website its give a error that you not have permission to view repository or page.
please give me some suggestions how to remove it??
Post A Comment
Title:
Name:
Email:
Comment:
Verification: