Calling VSTS APIs with C#

API, Visual Studio, Visual Studio Online
In the last API-related article, Personal Access Tokens and VSTS APIs, we looked at how we can use Fiddler, along with a Personal Access Token (PAT), to query the Visual Studio Team Services (VSTS) REST APIs. In this post, we’ll take a look at how we can use a 3rd party Fiddler extension, Request to Code, along with the “Paste JSON as Classes” Visual Studio feature to jump start the process of calling VSTS APIs with C#. Pre-Requisites – Install the Extension Before we get started we must make sure we’ve installed the Fiddler extension Request to Code. On the extension page, click on the download link to download the extension. It will come down as a ZIP file that contains a DLL along with a few other files. To…
Read More

Personal Access Tokens and VSTS APIs

API, TFS, Visual Studio Online
One of the great features of Visual Studio Team Services (VSTS) and Team Foundation Server (TFS) is its extensibility model. I am specifically referring to the REST APIs that Microsoft has started making available for their platform. Until recently, you had two options for authenticating with the REST APIs:Basic Authentication – requires that you enable alternate credentials on your VSTS/TFS account, Base64-encode them and send them “over the wire” along with your REST API call. This approach is simple though not very secure since your credentials are not encrypted “at rest” (though they are encrypted when used since the APIs utilize HTTPS at the transport layer). You can read more about using Basic Authentication with the REST APIs here.OAuth – this is a more secure approach than Basic Authentication, however…
Read More

VSTS/TFS Feature Index

TFS, Visual Studio Online
While the Visual Studio Team Services (VSTS)/Team Foundation Server (TFS) 2015 Feature Index has been out for a little while now, I’m not sure how many people actually know about it. If you’re somewhat familiar with VSTS/TFS then you are aware that you can use the VSTS/TFS platform to manage your source code, track work items and even run automated builds and deployments. But are you aware of everything else that can be accomplished with VSTS/TFS? You might be surprised!I am not going to detail everything the index covers because there is simply too much. However, here’s a high-level list of the categories within the index:Access and supported clientsAgile tools to plan and track workBacklogsBugs, tasks and issue trackingCustomize (TFS)Customize (VSTS)KanbanScaleScrumWorkflowAlerts and notificationsCodeGitTFVCPackage management (VSTS)Continuous DeliveryBuildRelease (VSTS – Preview)TestDashboards and…
Read More

Personal Access Tokens & VSTS

Visual Studio Online
If you happen to be using Git-based projects in Visual Studio Team Services (VSTS – formerly known as Visual Studio Online) then you might have already encountered Personal Access Tokens – or, PAT, for short. If you are not familiar with PATs in VSTS then read on… :-)As you are already aware, you can sign into VSTS using a Microsoft Account or, if your VSTS account is tied to Azure, an Azure Active Directory account. This approach works great when using the web-based interface for VSTS or when using Microsoft tools such as Visual Studio, both of which provide inherent support for Microsoft and AAD Accounts. If you are making use of 3rd party tools such as the Git command-line interface, SourceTree, etc., then the account types mentioned above don’t…
Read More

Custom Build Task Permissions in VSO

Team Foundation Build, Visual Studio Online
Following up on my Custom Build Tasks in VSO post I wanted to quickly show how you grant a VSO user permissions to upload build tasks into your VSO account. On Microsoft’s Build Tasks web page, it states that you need to be in the top level Agent Pool Administrators group to manipulate tasks. To view the Agent Pool Administrators: Sign in to your VSO account. Click on the Settings (gear) icon on the upper-right side of the page: Click on Agent pools and then Roles: Notice the Agent Pool Administrators group under Roles. This is NOT the group you are looking for!Instead, click on the All Pools node on the left: You will see the same Roles appear but this time they apply to all pools in the account.…
Read More

Enabling Verbose Output in Team Foundation Build Logs

Team Build, TFS, Visual Studio Online
There are a lot of great new features available in the new Team Foundation Build (formerly knows as Build v.Next) such as version history, web-based build definitions, open source build tasks, and much, much more. However, sometimes you simply want to accomplish something that you’re currently doing with your “old” XAML builds such as setting the logging verbosity to diagnostic. In TFS this was a simple property you could set when queuing a build. However, that property is nowhere to be found in the new Team Foundation Build system. There is, however, a way you can set logging verbosity to diagnostic in your new build definitions. In your build definition, navigate to the Variables tab and add a new variable named system.debug and set its value to true. Save your…
Read More

Updating Your Team Foundation Build Agents

Team Foundation Build, Visual Studio Online
One of the many improvements with the new version of Team Foundation Build is the ability for the build agents to self-update. This is a HUGE time saver for anyone that has lots of build agents spread across multiple build servers! There are a couple of ways to trigger an update to your build agent(s): The build agent gets updated automatically when a build task demanding a newer version of a build agent is executed. For example, if a task demands the build agent be from sprint 84 or higher (more on that in a moment) and your build agent is still on the sprint 83 release, then the agent will be instructed to update itself - automatically. Sweet! You can also manually update all build agents within a pool…
Read More

Team Foundation Build References

TFS 2015, Visual Studio Online
As I’ve been working with the new “vNext” version of Microsoft’s build technology, I’ve collected a few links along the way to some useful resources. You can probably find everyone of these links using your favorite search engine but sometimes it’s nice to be able to see them all in one place. That said, here’s a few links you might find useful… Read All About It If you’re looking to read about the new build system, check out these links: Team Foundation Build (on MSDN) – from here, you can get to information on deploying build agents (on Windows and/or Azure as well as non-Microsoft platforms). You can also read about how to setup build definitions as well as customizing the build process. Predefined Variable – lists the predefined variables…
Read More

Understanding Pools and Queues in VSO

Visual Studio Online
If you have just started making use of the new builds in Visual Studio Online (VSO), or even if you’ve been using them for a while, you might find the new concept of pools and queues a bit confusing – especially if you are used to the relationship between build controllers and agents in Team Foundation Server 2013 (and earlier) and the limitations that come along with them. It is exactly these limitations (e.g. allowing only a single build controller per project collection) that the pools and queues aim to eliminate. Not only does the new architecture resolve these issues it also greatly expands your options for organizing and utilizing your build agents. To add to that, you can also now run your build agents on non-Windows platforms (e.g. Mac/Linux)!…
Read More

Configuring Card Colors in Visual Studio Online

Visual Studio Online
Earlier this week, Microsoft announced the ability to customize the background colors of your kanban cards in Visual Studio Online (VSO). Not only does this give you the ability to simply add some color to an otherwise not-so-colorful board, it also allows you to make the board easier to understand at a glance. For example, you can color the background of the cards representing bugs red or you can highlight cards that are blocked in, say, yellow. We will walk through each of these scenarios below. In the board shown above, although you can’t immediately tell, the card labeled “1” is currently blocked (i.e. it has been assigned a tag named “blocked”). The card labeled “2” is a bug. Although it does have a red left border we can make…
Read More