Using an on-premises build server and agent with VSO while preserving the old build scripts

  1. Configure an on-premises system with TFS 2013 Update 2. Only install Build Server and connect it to your VSO repository.
  2. Install the software needed to build (like Winrar, reshack, etc).
  3. See http://blogs.msdn.com/b/aaronhallberg/archive/2008/07/28/a-minimal-tfsbuild-proj-file.aspx

This allows you to use the existing build scripts.

Use the following links to create a custom build activity: http://msdn.microsoft.com/en-us/library/dd647551.aspx. You can use C#, although the article says you should create a VB project.

Basic considerations when deploying a production Azure web site

All information is extracted from http://azure.microsoft.com/en-us/support/legal/sla/

Web sites SLA is 99.9%, calculated over a monthly billing cycle. That means a web site should not be available in a month for at most 43.8 minutes.

Important note for web sites: to be covered by SLA, the web site must be deployed at least in the Basic web hosting plan mode.

Traffic Manager SLA is 99.99%, calculated over a monthly billing cycle. That means during one month the traffic manager system may not respond for at most 4.32 minutes.

SQL Database SLA is 99.9%, calculated over a monthly billing cycle (maximum downtime 44 minutes).

Cloud Services when deployed with at least two role instances in different fault and upgrade domains, the Internet facing roles will have external connectivity at least 99.95% of the time.

When deploying a web site, use a “web role” instead of a “web site”.

Implement retry logic in the code accessing an SQL Azure database (for example, Entity Framework 6 has this logic built-in, see http://msdn.microsoft.com/en-us/data/dn456835.aspx).

Some Azure terminology

Fault domain

An Azure data center computers rack identifies with a fault domain.

Such a fault domain allocation is determined by Azure infrastructure at deployment time.

The service owner cannot control the allocation of a fault domain.

The service owner can programmatically detect the fault domain hosting a service.

Upgrade domain

An upgrade domain ensures an application is still available while being updated. This is achieved by upgrading one upgrade domain at a time.

The upgrade procedure for one upgrade domain is:

  • stop instances in upgrade domain
  • upgrade application
  • bring the instances back online

 

Close to falling in love with Honda

My Daewoo Cielo hinted me really hard that it’s time to put it to rest. Farewell, my friend, you’ve been a really good part of my life.

Now, it’s time to move on. So I’ve found a Honda Accord CL7, built in 2006 (I can’t afford a brand new car yet). It’s a marvelous piece of engineering, with automatic transmission, leather seats, adjustable steering wheel, sunroof and so on. I’m still reading the manual and there are a lot of controls. But I’m happy I’ve quickly found how to adjust the steering wheel: the old owner (like so many other car drivers) had the seat adjusted in a “lean back as much as possible” position. After I’ve got the car, I’ve adjusted the seat, but I didn’t know yet how to adjust the steering wheel height. And it was covering the speedometer, so I’ve found myself driving at 80 kph in 60 kph areas and constantly reminding to look down to check the speed. 

I confess that I enjoyed the experience, but as soon as I’ve got home I’ve read the user manual and in the morning I’ve adjusted the steering wheel. Now I can see the speedometer. And I can hardly wait for mid-June, when I’ll be able to take a vacation and use the car at 110 kph, to feel the Honda engine power.

There are some bad news with the car, but I guess that’s ok: it needs around 11 liters/100 km when driving in the city, it has a powerful engine so the insurance is high and I’ll only be able to finish the paperwork for it somewhere mid-June (the Romanian laws require each used car to pay a visit to the Romanian Auto Registry – RAR to validate the chassis and the engine match the data in the papers; one has to schedule to a RAR office and the one in my town seems to be as busy as a bee hive, I’ll be able to get the validation only on June 11’th).

Delete all workspaces for a single TFS user

$toExecute = "tf workspaces /owner:machine\user"
Invoke-Expression -Command $toExecute -OutVariable workspacesRaw
workspaces=@()
foreach( $workspaceRaw in $workspacesRaw)
{
   if( $workspaceRaw.StartsWith("Collection") 
       -or $workspaceRaw.StartsWith("Workspace ") 
       -or $workspaceRaw.StartsWith("--------") )
   {
        continue;
   }
   $tokens = $workspaceRaw.Split(" ")
   $workspaceName = $tokens[0].Trim()
   $workspaces += $workspaceName
}

foreach( $workspaceName in $workspaces )
{
      write-host "Processing $workspaceName"
      &tf workspace /collection:http://yourtfsserver:8080/tfs/DefaultCollection /delete "$workspaceName;owner"
}

I’m missing C++ preprocessor power

I had to write some code to demonstrate different options in our new rendering engine; the options were “high payload is placed closer to baseline”, “high payload is placed farther away from the baseline”, “payload size is ignored” and “left to right” or “right to left” processing.

Quick and easy, I wrote some statements wrapped by #if directives.
And then I’ve placed two #define statements right above these sections (like I would do in C++).
R# quickly smelled something, but I’ve understood only when trying to compile: unlike C++, C# requires all #define statements to appear at the very top of the file.

Young developers do not like conditional compilation

I find myself using more and more conditional compilation in our C# codebase.
No problem for me, as #if statements are standard in any normal C++ project (just think platform-independent code or MFC/ATL/Win32 SDK) and I’ve been using them since I’ve started my career.
However, my younger coworkers always have an organic reaction when seeing the #if keyword. Whenever I see it, I remember my reaction in my youth. But, as much as I’d like to help them, I cannot. Conditional compilation directives are part of our developer lives and they’ll stay there until mainframes, PC-s, tablets and mobiles will have exactly the same hardware architecture, the same CPU, the same OS … (think OS/360 ported on PC-s with all Windows applications running natively on it). So, probably not in our lifetimes.