get data from TFS in custom web application - tfs

I need to extract some data from TFS (Team Foundation Server) and create some excel sheet with data. To automate it, I am writing an application . But problem is:
How can I get data from TFS? Is there any webservice available for this or I need to parse HTML and then get the data.

No. TFS has broad coverage APIs and came in two flavors: Object Model and REST.
The Object Model is automatically installed when you install Visual Studio / Team Explorer, otherwise you can use the stand-alone MSI. This is a .NET API, but you can also find the Java version in case you need it.
The OM is simple to use for a .Net developer.
The REST API are kind of new and you should study if they satisfy your requirement. Some APIs are supported only on VSO and they miss from TFS on-premise and older versions.

Related

How to develope a Microsoft Dynamics solution with multiple teams?

Let me start with telling that I'm not a Microsoft Dynamics CRM specialist. I only have experience with developing .NET solutions without CRM or SharePoint and some experience how to use continues deployment of TFS to release custom applications. But for a current assignment I start with developing for Microsoft Dynamics CRM and I'm not alone.
Here we work with 2 scrum teams. Both have their own Microsoft Dynamics CRM 2016 environment and we use TFS to save our source code. Only source code, no configuration of CRM. When we release software, we need to manually merge the CRM configurations into a third environment (integration environment). This takes a lot of time and everything needs to be tested again.
I've searched on the internet and find a lot of content about customizing CRM but not how to work with multiple teams and get an automatic release pipeline for the changes both in code as in CRM.
Does anyone knows what the best practices is to develop a CRM solution with multiple teams and how to make a continues release pipeline to get the C# code and the CRM configuration automatically to the test, acceptation and production environments?
What I have done was to use the solution packager. The scrum teams would develop against their CRM instances and in a specific solutions.
They can then (either automatically using scripts and the CRM API or manually) export the solution and extract it to a version control friendly format.
This can then be committed to the version control system and then (using an automated build) get repackaged and versioned and ultimately deployed to a integration CRM instance as a managed package.
The use of managed vs un-managed packages is a bit more lengthy topic though

Visual Studio Team Services API

Does anyone know if there is a Visual Studio Team Services (http://visualstudio.com/) API? Please note I am referencing the "Service" and not the "Server".
I've been looking but I have been unable to find one.
See: Team Foundation Server OData API
Have a read, then follow the instructions from "Team Foundation Service authentication:" to set up your account/profile to access the Api.
You can then access the resources via the web Api.
There are also some sample applications near the top of that page that make use of this Api/OData.
As Edward and Christopher pointed out, the Client Object Model for the Cloud version of TFS and the on-premise version are identical, but not all API's will work with both systems. You can download the Client Object Model installer from the following location:
2012
2010 SP1 and Forward Compatibility GDR
Which API's work on which system is constantly changing, since new features are added to the cloud version all the time, while certain features are currently only available on the on-premise version (sharepoint integration and reporting for example).
Apart from that there is an OData API for TFS 2010 on-premise and that API is expected to be released for TFSvc and TFS on-premise in the near future. Probably coming to the TFSvc first.
Microsoft does provide REST ful as well as Client Object Model (DLL) based APIs which works both for on-premise Team Foundation Server and Visual Studio Team Services. But, REST ful API is still not complete, for example, there is still no end-point for getting drop-down field values. It is therefore recommended to use COM DLL APIs.
Visual Studio Team Services and Team Foundation Server now also has REST APIs, service hooks, and an extensions framework:
https://www.visualstudio.com/docs/integrate/overview

Working with TFS and Odata

I am working with Odata and TFS. I was able to get the OdataTFS file downloaded and working. I am trying to write a client console application that will access TFS so I can run queries againest it. I am trying to figure out this line
var tfsData = new TFSData.TFSData(new Uri("https://codeplexodata.cloudapp.net");
The way I usually access information on TFS is to into visual studio 2010, click connect to TFS Server, type in the server name and thats it. But here I am unsure how to do it. I haven't found any materials on how to connect to a server rather than to a codeplex. Where would I find the uri for this? Any help anything at all would be great, i have read the first 15 google searches on odata and still a little lost.
TFS does not have any OData services included in the installation.
You need to install the OData Service for Team Foundation Server on your local TFS server in order to use OData against your on-premises TFS.

What should I store/ Not store in TFS and how?

I'm trying to set up a TFS server for our small dev team, and since this is fairly new to me I have a couple of questions.
1) We are developing ASP.Net websites for internal use (intranet etc), these websites currently are not saved with visual studio solutions, they get saved basically as they are on the server and we just update them using Visual Studio by doing file > open website.
So my first question is should I save these as solutions in TFS? What would the benefit of this be?
Im coming from a background of developing WPF applications and have always seen everything saved with a solution in TFS.
2) What should we store in our TFS repository (and what should we exclude)?
At the moment I am storing source code & Documentation but is it really appropriate to store things like installers for VS plugins / small applications or should this kind of thing all be placed on a server someplace?
So my first question is should I save these as solutions in TFS? What
Yes, you could create a solution containing the different ASP.NET web applications.
would the benefit of this be?
Your source code will be version controlled
What should we store in our TFS repository
Source code, third party assemblies that your ASP.NET applications might require, script files, basically everything that allow to get your site up and running. Documentation should also be stored along with the project. Same stands for installers (the source code only, not the MSI) if those installers allow to deploy the ASP.NET application on the live servers.
and what should we exclude
Compiled assemblies, but they are automatically excluded by TFS anyway.

Is there a way to use a TFS2010 but that gets the code from a TFS2008?

at our company we are using a TFS 2008 server. We need some capabilities offered by TFS 2010 (like Lab Management) but currently we cannot change the server (we're a small part of a big company and doing that would make others to update their tools so it's not an option).
What I'm looking for is a way to install a TFS 2010 server that links somehow to the repository of the actual TFS server so when the 2010 MSBuild tries to build he takes sources from TFS2008.
Is this possible or do you think that could be another way of getting that to work?
Thanks for your assistance.
You can use the Integration platform to sync the sources and work items of TFS2008 with TFS2010.
See http://tfsintegration.codeplex.com/ for more information
You can also customize a build template so that it pulls in source code from anywhere.

Resources