Sunday 17 May 2015

A design consideration: SQL Server AlwaysOn Availability Mode for TFS

There are a few bits of any Team Foundation Server deployment which are either taken for granted, or completely ignored. One of them is:

Why shall I choose a Synchronous-Commit Availability Mode for the TFS Data Tier using SQL Server AlwaysOn?

If you are running an AlwaysOn Availability Group, you should know that you have a choice on how to write your Transaction Log – hence your database integrity. My suggestion is to run Team Foundation Server’s data tier in a Synchronous-Commit Availability Mode.

The reason is very simple: TFS relies heavily on the Transaction Log, and it is the only way to guarantee a point-in-time recovery. Moreover, if you run AlwaysOn you cannot have any database in the Availability Group set without the Full recovery mode.

So you must use the Transaction Log, and it is critical for the Team Foundation Server recovery – using the Synchronous-Commit mode ensures that each Secondary Replica in your Availability Group has an updated copy of the Transaction Log, synchronised at the same time as the Primary Replica, for immediate failover and service continuity.

You will face a really minor increase in the RTO (a few seconds, generally) and a performance loss, but we are talking about something you won’t be able to realise in general usage, and you are ensuring your service has an excellent reliability.

Friday 8 May 2015

A design consideration: Reporting Services on the Application Tier

There are a few bits of any Team Foundation Server deployment which are either taken for granted, or completely ignored. One of them is:

Why shall I install SQL Server Reporting Services on the Application Tier?

Fair question, if you are not considering installing it on a separate box – a different approach, usually not as common as the former.

The idea is to centralise all the client-originated HTTP traffic on a single endpoint. The endpoint of course can be a cluster address where you have multiple SSRS servers and Application Tiers, but the concept is the same. Centralise your traffic, possibly using DNS names. The documentation suggest that too:

image

so that the data tier is exactly that: the storage for Team Foundation Server’s (and related, if you want) databases.

Beware: it is not wrong to install it on the data tier (it is actually supported since Team Foundation Server 2008), but it is a matter of best practices.

Thursday 7 May 2015

TF30170 errors and the TFS Cache

Weird things happen, like this:

0

An item with the same key has already been added.How?!

Nothing catastrophic actually – it is just a matter of clearing the cache. This happened because this instance of Team Foundation Server was restored as part of a Disaster Recovery exercise, and its ID was not changed.

So, in order to solve this (and other similar TF30170 errors) just look at the logs – if you find that explanation message in one of the exceptions, or similar (like “cannot add LinkTypes relationship”) then I would suggest to clear the Team Foundation Cache:

<OSDrive>:\Users\<youruser>\AppData\Local\Microsoft\Team Foundation\

There are some folders in there, each containing a Cache folder. Empty those Cache folders, and try again. If there is nothing actually wrong underneath the Team Project would be created without problems.

A couple of remarks: it happens that the Team Project would be actually allocated on your target server even if the creation fails (it won’t be accessible and it is shown as Deleting). In this scenario it is pretty common that Visual Studio launches part of the temporary Team Project deletion but it would fail because it is not pointing at the right server GUID – open the TFS Admin Console and relaunch a manual deletion on the temporary Team Project.

Eventually, this might happen because you are not marking your Transaction Logs backups, so you restored some of the database out of the right order. Please use the TFS Backup Tool, or if you can’t, mark the transactions so you won’t hit that again.

Monday 4 May 2015

Visual Studio ALM at //BUILD – recap

Tons of stuff at this year’s //BUILD! It was really exciting and there were a lot of news about Windows 10, Edge and the ecosystem.

But this post is going to be about all that’s been announced for Visual Studio ALM. Brace yourselves, it is quite long :)

  • Visual Studio Code
    An evolution of Codename Monaco, this Electron-based app enables a great editing experience on not only Windows, but also MacOS and Linux. It is free and downloadable from here.
  • SonarQube and Team Foundation Server integration
    I already started working on it, this is a joint release from SonarSource and Microsoft to enable a deep integration between SonarQube and Team Foundation Server so we can have the same parity as Java for Technical Debt Analysis with SonarQube. It is a very well welcomed effort, I can’t wait to bring it into several projects I have in mind.
  • Visual Studio Release Management 2015
    Some light was shed on VSRM at //BUILD, we now know that much of the goodness of the new Release Management (with full support to Chef, Puppet and Team Build vNext) is going to be released with Team Foundation Server 2015 Update 1 or during the Summer on Visual Studio Online.
  • CodeLens
    This is quite big – CodeLens is integrated in Visual Studio Professional 2015! Plus, there are new indicators like Combined Authors, When Last Changed and support for every file type.
  • Cloud Load Test
    I can now define from where my traffic is going to be generated, so I can generate a better profile of my simulated usage.
  • REST API and Service Hooks for Team Foundation Server 2015
    As Visual Studio Online and Team Foundation Server share the same codebase, we are going to get both REST APIs and Service Hooks!
  • Extensions for Visual Studio Online
    Based on the existing REST APIs, Visual Studio Online is going to boast a brand new extension capability.
  • Application Insights in Public Preview
    Oh yes, Application Insights is in Public Preview now! And with additional capabilities – a better Java support, iOS and Android devices as first-class citizens, a new shiny integration in Eclipse and XCode!
  • IntelliTest
    Do you remember Smart Unit Tests? Well, the name wasn’t as good as it seemed to be, so it is now IntelliTest (like IntelliSense and IntelliTrace). There are two additional features now – Parametrized Unit Tests (you can define your data properties for the generated tests) and a Create Unit Tests menu.
  • Developer Assistant
    The Developer Assistant gets full access to the enormous amount of code hosted on GitHub! 21 millions of examples to browse.
  • GitHub extension as a Managed Hosting Provider
    GitHub enters Visual Studio as a new Managed Hosting Provider, so you can have a seamless integration inside the IDE like if it is Visual Studio Online or Team Foundation Server.
  • Improved Git branches and history views
    The integration of Git into Visual Studio proceeds, the branching view and the history view get lots of love, making it way easier to use on a daily basis.
  • Team Projects Rename
    Ten years later, we finally get Team Project rename in Team Foundation Server! This is a fantastic milestone (as it required lots of rework under the covers)!
  • Improved Build vNext preview
    Team Build preview is more aligned to the latest bits running on Visual Studio Online, it is a lot more stable and there are several new features in the web UI.

There is actually more, this is just a quick feature recap. For instance I purposely left out the Agile Boards improvements in Team Foundation Server, as I believe it is pretty clear it is being ported from Visual Studio Online to the on-premise product. In case you still have doubts, have a look at the Visual Studio Online and Team Foundation Server Feature Timeline.

Eventually, it is worth having a look at the Release Notes for TFS and Visual Studio.