SlideShare a Scribd company logo
Tulsa TechFest 2016
Using REST w/VSTS & TFS
Friday, August 5th
Jeff Bramwell
VP – Enterprise Architecture, Farm Credit Services of America
MVP - Visual Studio & Development Technologies
jeff@moonspace.net ::: @jbramwell
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Agenda
• History of APIs
• Why Extend?
• HTTP Methods
• REST Debugging Tools
• Authentication with VSTS/TFS
• HttpClient vs. HttpWebRequest
• Convert JSON to Classes
• Summary
History
• TFS 2005, 2008
• ASMX
• TFS 2010, 2012, 2013, 2015
• WCF Services
• TFS 2015/VSTS
• REST APIs
• TFS Object Model
• All Versions
Add support for custom processes/workflows
Audit users and related permissions
Batch push/commit/pull for files
Add ability to manage work item tags
Why Extend?
Add UI Elements
Builds
Security
Version Control
Examples
The options are limitless!What Else?
Available REST APIs
• Build 1.0
• Build 2.0
• Cloud Load Test
• Code Policy
• Dashboards and Widgets
• Git
• Packaging
• Projects and Teams
• Queues
• Release
• Service Hooks
• Team Room
• Test Management
• Version Control
• Work (Agile)
• Work Item Tracking
HTTP Methods
• Get
• Retrieve one or more resources
• POST
• Create a new resource
• PUT
• Update a resource
• PATCH
• Also update a resource (and more)
• DELETE
• Delete a resource
HTTP Debugging Tools
• Several Options:
• Telerik Fiddler
• Postman (for Chrome)
• HttpRequester (for Firefox)
• RESTClient (for Firefox)
• REST Easy (for Firefox)
• Many Others…
Authentication
Three approaches:
1. Basic Authentication
2. OAuth
3. Personal Access Tokens (PAT)
DEMO
Creating a Personal Access Token
DEMO
Calling an API: Getting a list of Builds
Sprinkle in Some C#
Multiple Approaches:
• Hand-code everything, including POCOs
• Make use of http://json2csharp.com/ to create initial POCOs
• Do the same thing as above but with Visual Studio 2015
• Use a Fiddler extension such as Fiddler Request To Code
DEMO
Let’s Generate Some Code!
HttpClient vs. HttpWebRequest
• HttpClient is built on top of HttpWebRequest
• HttpClient is generally easier to use and requires less code
• A single HttpClient instance can service multiple calls
• To multiple servers/hosts
• Support for await command
• Long story short…
• HttpClient for most tasks
• HttpWebRequest when you need more control
DEMO
Convert to HttpClient
Using the POCOs
• Essentially involves deserialization
• Quickest method: Use Newtonsoft.JSON NuGet package
• Will map JSON elements to class properties for you
DEMO
Now, let’s tie in the entity classes
Summary
• VSTS/TFS can be extended via REST APIs
• Very powerful
• Multiple ways to interact with and/or debug APIs
• Can be extended from multiple languages including C#, PowerShell,
JavaScript, etc.
• Not all WCF/TFSOM methods exposed via REST yet, but getting closer
More Examples
VSTS Tools
• Command-line utilities
• Custom build tasks (packaged as an extension)
• Source available on GitHub:
• https://github.com/jbramwell/VSTS-Tools
• Can download from Visual Studio Marketplace:
• https://marketplace.visualstudio.com/items?itemName=moons
pace-labs-llc.vsts-tools-build-extensions
Extending TFS and VSTS eBook
• https://leanpub.com/tfsapibook
Questions? More
Information?
REST API Reference for VS Team Services and TFS
• http://bit.ly/VSTSRESTAPI
Brian Harry (Product Unit Manager for TFS)
• https://blogs.msdn.microsoft.com/bharry/
My Blog
• http://blog.devmatter.com
Code/Extension Examples
• https://github.com/jbramwell/VSTS-Tools
Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
Your input is important!
http://TulsaTechFest.com

More Related Content

PPTX
Building Extensions in VSTS and TFS
PPTX
Performance testing with VSTs on- and off-premises
PPTX
SPS vancouver is it possible to do devops with SharePoint Framework
PPTX
SPS calgary 2017 introduction to azure functions microsoft flow
PPTX
Techorama migrate to sharepoint framework
PDF
Trying Out Tomorrow’s WordPress Today
PPTX
What's new in Visual Studio 2013 & TFS 2013
PPTX
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Building Extensions in VSTS and TFS
Performance testing with VSTs on- and off-premises
SPS vancouver is it possible to do devops with SharePoint Framework
SPS calgary 2017 introduction to azure functions microsoft flow
Techorama migrate to sharepoint framework
Trying Out Tomorrow’s WordPress Today
What's new in Visual Studio 2013 & TFS 2013
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1

What's hot (20)

PPTX
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
PDF
O365Con18 - Working with PowerShell, VS Code and GitHub - Thomas Vochten
PPTX
Building a Continuous Delivery Pipeline With Visual Studio
PPTX
SPSNL16 - Building Office 365 and SharePoint solutions using modern developer...
PPTX
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
PPTX
My slides from SharePoint Saturday Oslo
PDF
Canadian Cloud Summit 2022 - SharePoint Framework Tests Introduction
PDF
Automate yourself out of a job - Use ChatOps!
PPTX
Building Custom Visual Studio Team Service Build Tasks With VSTS DevOps Task SDK
PPTX
Building solutions with the SharePoint Framework - introduction
PPTX
Rencore Webinar: SharePoint Customizations - the most overlooked road block t...
PDF
[DevDay 2017] ReactJS Hands on - Speaker: Binh Phan - Developer at mgm techno...
PPTX
ASP.NET 5 & Unit Testing
PPTX
Integration Testing with Selenium
PPTX
How to build webapps with tools
PPTX
Microsoft ASP.NET 5 - The new kid on the block
PDF
O365Con18 - Implementing Automated UI Testing for SharePoint Solutions - Elio...
PPTX
Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx
PDF
Patterns and practices for building enterprise-scale HTML5 apps
PPTX
Tuenti Release Workflow v1.1
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
O365Con18 - Working with PowerShell, VS Code and GitHub - Thomas Vochten
Building a Continuous Delivery Pipeline With Visual Studio
SPSNL16 - Building Office 365 and SharePoint solutions using modern developer...
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
My slides from SharePoint Saturday Oslo
Canadian Cloud Summit 2022 - SharePoint Framework Tests Introduction
Automate yourself out of a job - Use ChatOps!
Building Custom Visual Studio Team Service Build Tasks With VSTS DevOps Task SDK
Building solutions with the SharePoint Framework - introduction
Rencore Webinar: SharePoint Customizations - the most overlooked road block t...
[DevDay 2017] ReactJS Hands on - Speaker: Binh Phan - Developer at mgm techno...
ASP.NET 5 & Unit Testing
Integration Testing with Selenium
How to build webapps with tools
Microsoft ASP.NET 5 - The new kid on the block
O365Con18 - Implementing Automated UI Testing for SharePoint Solutions - Elio...
Tanner Ellen - Forcelandia 2016 - Dev Stack.pptx
Patterns and practices for building enterprise-scale HTML5 apps
Tuenti Release Workflow v1.1
Ad

Viewers also liked (6)

PPT
VSTS Architecture Edition Overview
PPTX
Why API? - Business of APIs Conference
PDF
DevOps with Visual studio Release Management (Pieter Gheysens)
PPTX
Devops - VSTS - Source
PPTX
Devops - Git - VSTS
PPTX
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
VSTS Architecture Edition Overview
Why API? - Business of APIs Conference
DevOps with Visual studio Release Management (Pieter Gheysens)
Devops - VSTS - Source
Devops - Git - VSTS
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
Ad

Similar to Using REST with VSTS and TFS (20)

PDF
Xamarin Workshop Noob to Master – Week 5
PDF
There is REST and then there is "REST"
PPTX
Mastering REST APIs: A Comprehensive Guide to Building and Using REST Clients
PPTX
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
PPTX
Introduction to service stack
PPTX
SFDC REST API
PDF
Representational State Transfer (REST) and HATEOAS
PDF
11.Open Data Protocol(ODATA)
PPTX
PDF
Zyncro rest api feb 2013
PPTX
Windows Phone 8 - 12 Network Communication
PPTX
Windows 8 Metro apps and the outside world
PPTX
Time to REST: testing web services
PPTX
Rest webservice ppt
PPTX
Introduction To REST
PPTX
BePUG - PowerShell and REST - Expanding your Horizon
PPTX
Mini-Training: Let's have a rest
PPTX
80068
PDF
Intro to Web Services - 2015 STC Summit talk
PDF
Rest - Representational State Transfer (EMC BRDC Internal Tech talk)
Xamarin Workshop Noob to Master – Week 5
There is REST and then there is "REST"
Mastering REST APIs: A Comprehensive Guide to Building and Using REST Clients
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
Introduction to service stack
SFDC REST API
Representational State Transfer (REST) and HATEOAS
11.Open Data Protocol(ODATA)
Zyncro rest api feb 2013
Windows Phone 8 - 12 Network Communication
Windows 8 Metro apps and the outside world
Time to REST: testing web services
Rest webservice ppt
Introduction To REST
BePUG - PowerShell and REST - Expanding your Horizon
Mini-Training: Let's have a rest
80068
Intro to Web Services - 2015 STC Summit talk
Rest - Representational State Transfer (EMC BRDC Internal Tech talk)

More from Jeff Bramwell (20)

PPTX
The Power of Azure DevOps - Global Azure Day 2020
PPTX
The Power of Azure DevOps
PPTX
A Roadmap to Enterprise Quality
PPTX
The Power of Azure DevOps
PPTX
The Power of Azure DevOps
PPTX
Roadmap to Enterprise Quality
PPTX
The Future is Here
PPTX
Evaluating Docker in the Enterprise - Getting Started
PPTX
Adventures in enterprise architecture
PPTX
Building with Visual Studio Online
PPTX
Introduction to Windows 8 Development
PPTX
Visual studio 2012 - What's in it for me?
PPTX
Getting Started With the TFS Object Model
PPTX
What's Coming in Visual Studio v.Next
PPTX
Getting Started with WP7 Development
PDF
TDC 2010 - VS2010 ALM - What's In It for Me
PDF
TDC 2010 - Migrating to TFS 2010 - Lessons Learned
PDF
Tulsa TechFest 2010 - What's New in TFS 2010
PDF
Tulsa TechFest 2010 - Migrating to TFS 2010 - Lessons Learned
PDF
Tulsa TechFest 2010 - Creating Quality Software - A Look at Visual Studio 201...
The Power of Azure DevOps - Global Azure Day 2020
The Power of Azure DevOps
A Roadmap to Enterprise Quality
The Power of Azure DevOps
The Power of Azure DevOps
Roadmap to Enterprise Quality
The Future is Here
Evaluating Docker in the Enterprise - Getting Started
Adventures in enterprise architecture
Building with Visual Studio Online
Introduction to Windows 8 Development
Visual studio 2012 - What's in it for me?
Getting Started With the TFS Object Model
What's Coming in Visual Studio v.Next
Getting Started with WP7 Development
TDC 2010 - VS2010 ALM - What's In It for Me
TDC 2010 - Migrating to TFS 2010 - Lessons Learned
Tulsa TechFest 2010 - What's New in TFS 2010
Tulsa TechFest 2010 - Migrating to TFS 2010 - Lessons Learned
Tulsa TechFest 2010 - Creating Quality Software - A Look at Visual Studio 201...

Recently uploaded (20)

PPTX
Transform Your Business with a Software ERP System
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
history of c programming in notes for students .pptx
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
Introduction to Artificial Intelligence
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
top salesforce developer skills in 2025.pdf
PDF
iTop VPN Free 5.6.0.5262 Crack latest version 2025
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
System and Network Administration Chapter 2
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Transform Your Business with a Software ERP System
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
wealthsignaloriginal-com-DS-text-... (1).pdf
history of c programming in notes for students .pptx
CHAPTER 2 - PM Management and IT Context
Which alternative to Crystal Reports is best for small or large businesses.pdf
How to Choose the Right IT Partner for Your Business in Malaysia
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Reimagine Home Health with the Power of Agentic AI​
Computer Software and OS of computer science of grade 11.pptx
Introduction to Artificial Intelligence
PTS Company Brochure 2025 (1).pdf.......
top salesforce developer skills in 2025.pdf
iTop VPN Free 5.6.0.5262 Crack latest version 2025
Design an Analysis of Algorithms II-SECS-1021-03
Digital Systems & Binary Numbers (comprehensive )
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
System and Network Administration Chapter 2
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx

Using REST with VSTS and TFS

  • 1. Tulsa TechFest 2016 Using REST w/VSTS & TFS Friday, August 5th Jeff Bramwell VP – Enterprise Architecture, Farm Credit Services of America MVP - Visual Studio & Development Technologies [email protected] ::: @jbramwell
  • 2. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 3. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions!
  • 4. Agenda • History of APIs • Why Extend? • HTTP Methods • REST Debugging Tools • Authentication with VSTS/TFS • HttpClient vs. HttpWebRequest • Convert JSON to Classes • Summary
  • 5. History • TFS 2005, 2008 • ASMX • TFS 2010, 2012, 2013, 2015 • WCF Services • TFS 2015/VSTS • REST APIs • TFS Object Model • All Versions
  • 6. Add support for custom processes/workflows Audit users and related permissions Batch push/commit/pull for files Add ability to manage work item tags Why Extend? Add UI Elements Builds Security Version Control Examples The options are limitless!What Else?
  • 7. Available REST APIs • Build 1.0 • Build 2.0 • Cloud Load Test • Code Policy • Dashboards and Widgets • Git • Packaging • Projects and Teams • Queues • Release • Service Hooks • Team Room • Test Management • Version Control • Work (Agile) • Work Item Tracking
  • 8. HTTP Methods • Get • Retrieve one or more resources • POST • Create a new resource • PUT • Update a resource • PATCH • Also update a resource (and more) • DELETE • Delete a resource
  • 9. HTTP Debugging Tools • Several Options: • Telerik Fiddler • Postman (for Chrome) • HttpRequester (for Firefox) • RESTClient (for Firefox) • REST Easy (for Firefox) • Many Others…
  • 10. Authentication Three approaches: 1. Basic Authentication 2. OAuth 3. Personal Access Tokens (PAT)
  • 11. DEMO Creating a Personal Access Token
  • 12. DEMO Calling an API: Getting a list of Builds
  • 13. Sprinkle in Some C# Multiple Approaches: • Hand-code everything, including POCOs • Make use of http://json2csharp.com/ to create initial POCOs • Do the same thing as above but with Visual Studio 2015 • Use a Fiddler extension such as Fiddler Request To Code
  • 15. HttpClient vs. HttpWebRequest • HttpClient is built on top of HttpWebRequest • HttpClient is generally easier to use and requires less code • A single HttpClient instance can service multiple calls • To multiple servers/hosts • Support for await command • Long story short… • HttpClient for most tasks • HttpWebRequest when you need more control
  • 17. Using the POCOs • Essentially involves deserialization • Quickest method: Use Newtonsoft.JSON NuGet package • Will map JSON elements to class properties for you
  • 18. DEMO Now, let’s tie in the entity classes
  • 19. Summary • VSTS/TFS can be extended via REST APIs • Very powerful • Multiple ways to interact with and/or debug APIs • Can be extended from multiple languages including C#, PowerShell, JavaScript, etc. • Not all WCF/TFSOM methods exposed via REST yet, but getting closer
  • 20. More Examples VSTS Tools • Command-line utilities • Custom build tasks (packaged as an extension) • Source available on GitHub: • https://github.com/jbramwell/VSTS-Tools • Can download from Visual Studio Marketplace: • https://marketplace.visualstudio.com/items?itemName=moons pace-labs-llc.vsts-tools-build-extensions Extending TFS and VSTS eBook • https://leanpub.com/tfsapibook
  • 21. Questions? More Information? REST API Reference for VS Team Services and TFS • http://bit.ly/VSTSRESTAPI Brian Harry (Product Unit Manager for TFS) • https://blogs.msdn.microsoft.com/bharry/ My Blog • http://blog.devmatter.com Code/Extension Examples • https://github.com/jbramwell/VSTS-Tools
  • 22. Tulsa TechFest 2016 | Fri, Aug 5th, 2016 | OSU - Tulsa | 70+ Speakers, 20+ Tracks & 85+ Sessions! Your input is important! http://TulsaTechFest.com

Editor's Notes

  • #6: REST APIs do not yet have full parity with WCF services/TFS Object Model There is also a Java SDK as well as an unsupported OData API
  • #7: Add custom version capabilities to assemblies/NuGet packages as part of build process Ensure projects have permissions configured based on desired guidance Make mass changes to code across multiple projects – e.g. configuration file updates Rename or delete tags
  • #8: As of August, 2016
  • #9: Talk about issues with using PUT when contracts have changed (e.g. adding a new field that calling clients are unaware of and the new field ends up being nulled out on updates)
  • #10: Fiddler was acquired by Telerik back in 2012 Talk about issues with using PUT when contracts have changed (e.g. adding a new field that calling clients are unaware of and the new field ends up being nulled out on updates)
  • #11: If using Basic Authentication, ensure SSL is enabled. https://www.visualstudio.com/en-us/docs/integrate/get-started/auth/overview PATs are simple to implement https://www.visualstudio.com/en-us/docs/integrate/get-started/auth/oauth OAuth provides a familiar user experience for most users – rather than requiring them to create and provide a PAT https://www.visualstudio.com/en-us/docs/integrate/get-started/auth/overview
  • #14: HttpWebRequest came first – gives you full control over the web request but tends to require more code HttpClient is built on top of HttpWebRequest but requires much less code (and could also be a tad slower) Supports async calls Requires .NET 4.5 (or higher)
  • #16: HttpWebRequest came first – gives you full control over the web request but tends to require more code HttpClient is built on top of HttpWebRequest but requires much less code (and could also be a tad slower) Supports async calls Requires .NET 4.5 (or higher)
  • #21: HttpWebRequest came first – gives you full control over the web request but tends to require more code HttpClient is built on top of HttpWebRequest but requires much less code (and could also be a tad slower) Supports async calls Requires .NET 4.5 (or higher)