One of the new features that comes with Windows Azure Web Sites is the ability to publish your web site using Team Foundation Services. Team Foundation Services is Microsoft’s TFS offering in the cloud. Team Foundation Services allows you to keep your source code and work items in the cloud. With Team Foundation Services your can work with your current tools, and languages, manage source code on- and off- line, and implement builds and continuous unit testging. In short, everything you love about TFS, but now it’s in the cloud. In this post I’ll show you how to link your new Windows Azure Web Site to a Team Foundation Services account to set up automatic deployments.
The first thing you’ll need to do, if you don’t have one already, is sign up for a Team Foundation Services account at http://tfspreview.com and create a project. Be sure to make note of the URL of your TFS account. It will be something like https://youraccount.tfspreview.com.
Next you’ll need to do, if you haven’t already done so, is to enable the new Windows Azure Web Sites features for you Azure subscription. You can do so by logging into http://account.windowsazure.com.
Once Windows Azure Web Sites are enabled for your subscription, log in to the management portal at http://manage.windowsazure.com
Click on the +NEW button on the bottom of the page
Click on WEB SITE
Click QUICK CREATE
Enter a URL for your web site, select a REGION (aka data center) where you want the web site to run, and select the SUBSCRIPTION you want to associated with the web site. Then click the CREATE WEB SITE button on the bottom of the page. (Note: during the preview period on the East US region supports Windows Azure web sites.)
Wait for your web site to have a STATUS of running. It took two minutes for the site I created along with this blog post get up and running, but your mileage may vary.
Once the site is running click on the NAME of the site. This will bring you to the site’s DASHBOARD. On the right hand side of the dashboard there is a *quick glance* section. Click on the *Set up TFS publishing* link.
Enter your TFS account name at the Authorize TFS connection prompt and click the Authorize Now link.
Click the Accept button to link your TFS account to the Windows Azure Web Site.
Select the TFS project to publish.
Make note of the TFS URL, and view instructions, if you need them, on how to check in code from Visual Studio 2012 or Visual Studio 2010.
At this point, you’re ready to start developing as you normally would in Visual Studio. I would recommend creating a simple web project (ASP.NET or ASP.NET MVC 2/3/4). Make any changes you wish and check into TFS. Once you check in, your Windows Azure Web Site will pick up the change and deploy.
Once the deployment is active, go back to the Windows Azure management portal and go to the DASHBOARD for your site by clicking the DASHBOARD link on the top of the page. On the right hand site of the page is the SITE URL for your web site.
Click on the link and you will be redirected to your site.
I also created a screencast of this process. Just click on the picture below to start watching.