This is a follow on post from my introduction to Windows Azure Websites and shows you how you can synchronise your website in TFS with Windows Azure.
One of the biggest problems with the way you deploy applications to Windows Azure is that minor changes (e.g .markup, content and styling) require a redeploy to publish the changes. Windows Azure Websites solves this problem by allowing you to synchronise your website with Team Foundation Server or GIT.
In this post I will show you how easy it is to manage your websites in version controlled environment using Team Foundation Service. Team Foundation Service is a cloud hosted version of Team Foundation Server.
This works by creating a continuous integration build with your source code that will automatically deploy your website after successful build each time code is checked in.
This is configured as follows:
Click the “+” button at the bottom of your portal screen and select Website –> Quick Create
Enter the url details and click Create Web Site
An Empty site has now been created.
This site now needs to be link to your Team Foundation Service. Click on the website in the dash board and then select “Setup TFS Publishing”. you will also note that you can use a GIT repository as well as TFS.
Enter your TFS url (or create a new one), then click Authorize Now.
this connects through to your TFS service and setup the CI build that will deploy your application to the cloud.
The TFS site will now be displayed asking you to authorize the connection
You now need to pick the website you want to deploy. If you haven’t create a site yet then you need to go to ~Visual Studio, create your site and check it in to TFS.
You have now linked your web site in TFS to the Azure Website. This will take a few moments to synchronise.
Your website has not been deployed yet. You need to make a change and then check the changes in
upon check-in the build is started
When the build is complete the new website is deployed
You can also revert back to older versions of the web site by clicking the desired version and then clicking redeploy:
This will start the redeploy of the older version:
A new build is kicked off using the same changeset details as the original deployment. Once the build is complete the web site is reverted back. this whole cycle only took a few minutes so it is a lot faster than the redeploy mechanism you had previously.
TFS and Windows Azure provide a good mechanism for version controlling your website. Adding application life cycle management to any software development activity is a good thing.