Archives For team foundation server

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

azure-tfs-01

Click on the +NEW button on the bottom of the page

azure-tfs-02

Click on WEB SITE

azure-tfs-03

Click QUICK CREATE

azure-tfs-04

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.)

azure-tfs-05

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.

azure-tfs-06

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.

azure-tfs-07

Enter your TFS account name at the Authorize TFS connection prompt and click the Authorize Now link.

azure-tfs-08

Click the Accept button to link your TFS account to the Windows Azure Web Site.

azure-tfs-09

Select the TFS project to publish.

azure-tfs-10

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.

azure-tfs-12

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.

azure-tfs-13

Click on the link and you will be redirected to your site.

azure-tfs-14

I also created a screencast of this process. Just click on the picture below to start watching.

azure-tfs-15

ag

{Every now and then I find that I have to do some kind of configuration magic to get my development environment working the way I want it to. I promptly forget it until I have to do it again 3-6 months later when I replace my machine. By then I have no idea what I did so I have to look it up again. The point of this Note to Self series is to remind me of exactly what I did so I don’t have to try to remember the name of some odd command line tool and the various parameters that go along with it.}

Let me start by saying that I’m a big fan of Team Foundation Server (TFS). I think the product has come a long way since it’s initial release in 2005. I wish it had some more features that could make it a distributed version control system (i.e. Git and Mercurial), but all in all it’s a good product

With that said, one of the things I’m not a fan of is how Visual Studio (VS) attempts to connect to TFS on startup. There are two specific reasons I don’t like this. First, it slows down VS startup. Second, I have multiple clients, not all of whom expose their TFS instances over http/s. If the last instance of TFS I was connected happens to belong to one of these clients, not only do I have to wait for the long startup, I have to endure a dialog telling me that VS could not connect to TFS. This is especially frustrating when all I want to do is create a simple console app to test out an idea or two. It’s so frustrating, that I’m acutally getting frustrated right now as I write this. Grrrr….

Luckily all is not lost and this no longer needs to be endured. With a small registry tweak you can prevent VS from connecting to TFS (2005, 2008, and 2010) on startup. Here’s what you do:

1. Backup your registry. Don’t skip this step. SERIOUSLY! DON’T SKIP IT!

2. Navigate to Team Foundation key:

For VS 2005 navigate to: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\TeamFoundation

For VS 2008 navigate to: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\TeamFoundation

For VS 2010 navigate to: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\TeamFoundation

3. Add a registry key “AutoLoadServer” (type DWORD)

4. Setting the value to be 0 (Do not connect automatically or 1 to connect automatically).

This has made me a happier, well less frustrated, developer. I hope it does the same for you.