Git Publishing Orchard CMS to Windows Azure

Git Publishing Orchard CMS to Windows Azure

Windows Azure has a really nice feature that allows you to push deployments from a public Git repository on GitHub or Codeplex as well as push deployments from a local Git repository on your development PC. In the near future, Azure will support private Git repositories as well. You can easily use Git Publishing with Azure and an Orchard CMS Website with the addition of 1 file that needs to be added to your Orchard Website!

Git Publishing on Windows Azure Web Sites

I don't plan on going into the details of Git Publishing on Windows Azure. You can find a good tutorial on that in the Windows Azure Website.

Essentially, you need to create a web site in Windows Azure and then setup Git Publishing in the web site's dashboard. If it is your first time using Git Publishing, you will also need to create some credentials ( username and password ).

Git Publishing on Windows Azure

During the set-up process Windows Azure will create a Git Repository for you. You can then either push files from a local repository on your development PC or have Windows Azure listen for changes in your public GitHub and Codeplex Git repositories and create a new deployment everytime you commit a change to those remote repositories. By default Azure will follow the master branch, but you can change that in deployment configurations.

Orchard CMS Git Repository on Windows Azure

All of this is pretty simple after you have done it once.

Git Publishing Orchard CMS Website to Windows Azure

When Git Publishing an Orchard CMS Website to Azure you need to include an extra file at the root directory of the Orchard Website that is not pre-packaged with Orchard by default. Not doing so will result in a deployment error on Azure telling you that it does not know which project file ( .csproj ) to compile first ( or something along those lines ). This, of course, assumes you haven't precompiled the binaries, etc. and your Orchard Website is in it's default state as if you download Orchard.Web from CodePlex or installed Orchard via the WebMatrix Gallery, etc. In this case Orchard is set-up for dynamic compilation and all the source files will be included in the website.

To avoid this error you need to add a .deployment file to the root of the Orchard Website. Thanks to Sebastien Ros for this tip!

Deployment File for Publishing Orchard CMS to Windows Azure

There is nothing complex about this file.

project = .

With the addition of the .deployment file in your Orchard CMS Website you can now successfully deploy Orchard CMS via Git Publishing to Windows Azure. After I push changes from my local Git Repository to Windows Azure the deployment of Orchard CMS is successful!

Git Push Orchard CMS to Windows Azure


With the new Web Sites Functionality and Git Publishing Features in Windows Azure, Azure is quite a bit easier to use. I look forward to the private Git Repository support in Windows Azure as well as the upcoming Orchard 1.6 that will support ASP.NET MVC 4, Web API, and NHibernate 3.0!

If you are new to Git, check out my recent book review of Version Control with Git, 2nd Edition.

Other posts on Orchard CMS and Azure include: Installing Orchard CMS as an Azure Web Site and Installing Orchard CMS on Windows Azure with WebMatrix 2.