martedì 15 aprile 2014

How to check for Team Foundation Server’s job running time

This is very quick but helpful IMHO.

Scenario: you are an external consultant and you need to run a job from the Team Foundation Server web services (ProcessWarehouse, just to mention one of them), but you cannot access the server itself because of some security policy.

You ask someone in the IT department to run it on behalf of you, but of course you want to check how long does it take. How?

By using the TFS Operational Intelligence. If you check the Job Queue list, you will get all the running and scheduled jobs for the server.


If a job is running you will get the actual running time, otherwise the last execution’s time.

domenica 6 aprile 2014

Review – Professional Visual Studio 2013

WP_20140402_09_08_59_Pro Another year, a new IDE, a new book about it.

Do you want to compare it to the last year’s one? Fair enough – it is an updated overview of the Microsoft development stack. This is enough to justify it in full.

Bruce Johnson (Visual C# MVP) refreshed the 2012 one, covering a huge (1050 pages) amount of topics. Of course it is not a deep dive style book, it is not its target, but it gives the right amount of information on everything surrounds the core topic – Visual Studio itself.

To summarize in one idea: if you see something in the IDE, it is covered here.

Again at the end, Visual Studio Ultimate and Team Foundation Server are separately reviewed in order to avoid polluting the core stuff. A great choice I fully back, by the way.

It is a book every developer should have on the shelf, because sometimes picking up a specific chapter is better than just searching on the MSDN or a search engine.

sabato 22 marzo 2014

IISReset and TFSServiceControl quiesce

Isn’t it the same if I just run IISReset /stop to take the Team Foundation Server down?

No, it isn’t.

If you just run IISReset /stop, you are just locking the IIS access – but the Team Foundation Server is still up and running, it is just not reachable.

This is why TFSServiceControl quiesce is needed: by running it, you are effectively taking down the server, stopping the Application Pools, all the jobs and the agents running on it. Moreover, MSDN states “You cannot manually perform all of the tasks carried out by the TFSServiceControl command.”, so little choice here Smile

Other than being sure of the TFS’ status and consistency, by running it together with IISReset you are ensuring that the IIS won’t be overstressed and it won’t forward any query to the TFS itself.

Basically, you are locking the safe (TFS) and the room’s door (IIS).

martedì 11 marzo 2014

Suggestions for preparing a TFS deployment with SQL AlwaysOn

SQL Server AlwaysOn is a utterly cool technology, but it is not a technology itself which solves all the problems you may have.

In particular, it is not just about tweaking a couple of settings and adding servers as needed. A careful planning and thorough tests are mandatory in order to succeed without affecting the existing service or going overtime. So I wanted to sum up some tips I found during a project I am following with a huge deployment of Team Foundation Server 2013 which uses SQL Server AlwaysOn as an underlying High Availability solution.

  1. Size your storage
    I am dealing with TBs of data, so I am experiencing that TBs of storage flies away in a snap. Do not underestimate your storage size and do not rely just on SANs. Importing your data takes time and space, especially if you restore your databases to the secondary replica using the Full mechanism of backup-and-restore provided by SQL Server AlwaysOn.
  2. You can’t mix and match all the HA technologies
    Not all the SQL HA technologies are supported by TFS in the first place. MSDN is pretty clear on this, no replication and no log shipping. Log shipping could technically work, but you won’t be supported by the Microsoft CSS, so it is a no no. You can mix a clustered SQL Server with another one in another location within the same AlwaysOn Availability Group though, and it is pretty robust. Keep in mind anyway that TFS is pretty agnostic about the underlying SQL deployment though, in fact the only feature which requires a specific configuration is AlwaysOn Availability Groups.
  3. The MultiSubnetFailover setting
    When configuring Team Foundation Server for using AlwaysOn Availability Groups, remember to tick the specific checkbox about this setting. Beware of the setting: if you are not directly using an AG but you select it at TFS configuration time, you are going to be in trouble. If you are restoring it to a new server, launch TFSConfig RegisterDB to enable it:
    TFSConfig RegisterDB /SQLInstance:MyDB\namedinstanceifneeded /databaseName:Tfs_Configuration /usesqlalwayson

  4. All the Team Foundation Server databases must be in the AlwaysOn Availability Group
    No exceptions to this – if you use it, all the DBs must be contained in the AG.

domenica 2 marzo 2014

How to perform a TFS Security Audit

It is common to be asked for performing a security audit on Team Foundation Server, and it is not a nightmare as it would seem…

The easiest way is to download the Audit Log. You can find it in the Access Levels administration page:


What you are going to get is a .csv file, containing all the groups and accounts allowed into Team Foundation Server, each with its unique internal URI (vstfs://…), the last access date and its access level.

But this is just the beginning – you get a list of flat users and groups, without their relationships. In order to get these, you can use the TFSSecurity command with the /i, /im and /imx switches.

These will give you all the informations about each user/group and its relationships and privileges, so wrapping their outputs and creating a very simple report is just a matter of time Smile

martedì 18 febbraio 2014

Why shall I use Application Insights?

There has been a lot of noise around the latest kid – Application Insights on Visual Studio Online.

It is a fantastic solution, but I did not clearly stated anywhere is:

Why shall I use it?

I think the answer is pretty easy – everybody needs diagnostics and logging while in production. It can be expensive to setup a custom solution, which spreads among different devices, different infrastructures (cloud anyone?), different networks.


Application Insights is a great solution for that, as it provides a broad range of features aimed at addressing almost every scenario in that field.

For example, the possibility of downloading an IntelliTrace file from an exception which has been logged on a specific error is just invaluable, providing all the information I might need for fixing that specific issue.


Or talking about usage – how handy can it be a service which collects and aggregates all the information related to my usage data from my real users.


I mean, from the page pattern they follow to the device they use, it is a range of data who can be used in many ways, from diagnostics to marketing. Why losing it?


As we know, integrating it is a matter of adding some JavaScript lines, a couple of files or a bunch of lines of code depending on the platform we are targeting – this is why it is really worth integrating it in our projects: with a minimal effort we can get a giant stream of information to use as a source for a broad range of tasks, not just developer-focused ones.

domenica 16 febbraio 2014

Application Insights Visual Studio Add-in preview – what is that?

Brian Harry recently blogged about that, this is an add-in for adding Application Insights’ telemetry straight from Visual Studio itself.

It is helpful, because once you install it you can add AI to all your new projects OOB:


It is already tied to your Visual Studio Online account (after a login, of course). Then it is going to automatically detect what project type you created and it is going to set it up for AI in a snap.