Skip to content

Commit b2f9227

Browse files
Merge pull request #8075 from MicrosoftDocs/users/chcomley/uuf-442045
UUF fix, PAT replacements, refresh: dotnet-client-libraries.md
2 parents 1ad556d + 352f82b commit b2f9227

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

docs/integrate/concepts/dotnet-client-libraries.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
---
22
title: .NET client libraries
3-
description: Easily integrate with Azure DevOps from apps and services on Windows.
3+
description: Learn how to use Azure DevOps .NET client libraries to integrate work items, Git repositories, builds, and pipelines into your C# applications and Windows services.
44
ms.assetid: 474cdb4f-9a5e-49fb-84b2-9c540ebcf98b
5+
ai-usage: ai-assisted
56
ms.subservice: azure-devops-ecosystem
67
ms.custom: devx-track-dotnet
78
ms.topic: conceptual
89
monikerRange: '<= azure-devops'
910
ms.author: chcomley
1011
author: chcomley
11-
ms.date: 03/20/2025
12+
ms.date: 07/02/2025
13+
#customer intent: As a .NET developer, I want to integrate my C# applications with Azure DevOps services like work items, Git repositories, builds, and pipelines using official client libraries and REST APIs.
1214
---
1315

1416
# .NET client libraries
@@ -40,8 +42,6 @@ The following table maps the package versions of the .NET client libraries to th
4042
|---------------|---------------------|
4143
|16.205.x| `versions >= Azure DevOps Server 2022` |
4244
|16.170.x| `versions >= Azure DevOps Server 2020`|
43-
|16.153.x| `versions >= Azure DevOps Server 2019 Update 1`|
44-
|16.143.x| `versions >= Azure DevOps Server 2019`|
4545

4646
For the latest preview versions, see the [NuGet packages gallery](https://www.nuget.org/packages?q=azure+devops+.net).
4747

@@ -69,7 +69,7 @@ The following table lists the .NET client libraries available for accessing vari
6969
|[Microsoft.Azure.Pipelines.Policy.Client](https://www.nuget.org/packages/Microsoft.Azure.Pipelines.Policy.Client/)<br/>Provides access to the pipeline approvals, checks, and authorization via public REST APIs. |`Microsoft.Azure.Pipelines.Policy.Client.dll` |
7070

7171
> [!TIP]
72-
> If you have an existing Windows application or service that uses the TFS Client Object Model, use `Microsoft.TeamFoundationServer.ExtendedClient`. This package provides access to the older SOAP-based APIs, which are necessary for certain functionalities not available in the newer REST APIs. However, this package doesn't support .NET Standard and is intended for use only when the REST APIs don't offer the required functionality.
72+
> **Legacy SOAP APIs**: If you have an existing Windows application that uses the TFS Client Object Model, use `Microsoft.TeamFoundationServer.ExtendedClient` for SOAP-based APIs. This package is only recommended when REST APIs don't provide the specific functionality you need (such as TFVC workspace creation). This package doesn't support .NET Standard and Microsoft is no longer investing in SOAP-based APIs.
7373
7474
## Soap package
7575

@@ -99,20 +99,21 @@ using Microsoft.VisualStudio.Services.Client;
9999
using Microsoft.TeamFoundation.SourceControl.WebApi;
100100
using Microsoft.VisualStudio.Services.WebApi;
101101

102-
const String c_collectionUri = "https://dev.azure.com/fabrikam";
103-
const String c_projectName = "MyGreatProject";
104-
const String c_repoName = "MyRepo";
102+
const string collectionUri = "https://dev.azure.com/fabrikam";
103+
const string projectName = "MyGreatProject";
104+
const string repoName = "MyRepo";
105+
const string accessToken = "your-microsoft-entra-id-token";
105106

106-
Uri orgUrl = new Uri(c_collectionUri);
107+
Uri orgUrl = new Uri(collectionUri);
107108

108-
// Connect to Azure DevOps Services
109-
VssConnection connection = new VssConnection(orgUrl, new VssBasicCredential(string.Empty, personalAccessToken));
109+
// Connect to Azure DevOps using Microsoft Entra ID token
110+
VssConnection connection = new VssConnection(orgUrl, new VssBasicCredential(string.Empty, accessToken));
110111

111112
// Get a GitHttpClient to talk to the Git endpoints
112113
using (GitHttpClient gitClient = connection.GetClient<GitHttpClient>())
113114
{
114115
// Get data about a specific repository
115-
var repo = gitClient.GetRepositoryAsync(c_projectName, c_repoName).Result;
116+
var repo = gitClient.GetRepositoryAsync(projectName, repoName).Result;
116117
}
117118
```
118119

@@ -131,13 +132,13 @@ namespace ConsoleApp1
131132
const string collectionUri = "https://dev.azure.com/fabrikam";
132133
const string projectName = "MyGreatProject";
133134
const string repoName = "MyRepo";
134-
const string pat = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
135+
const string accessToken = "your-microsoft-entra-id-token";
135136

136137
static void Main(string[] args)
137138
{
138-
var creds = new VssBasicCredential(string.Empty, pat);
139+
var creds = new VssBasicCredential(string.Empty, accessToken);
139140

140-
// Connect to Azure DevOps Services
141+
// Connect to Azure DevOps Services using Microsoft Entra ID token
141142
var connection = new VssConnection(new Uri(collectionUri), creds);
142143

143144
// Get a GitHttpClient to talk to the Git endpoints
@@ -151,6 +152,9 @@ namespace ConsoleApp1
151152

152153
```
153154

155+
> [!TIP]
156+
> **Microsoft Entra ID authentication**: The previous examples use Microsoft Entra ID tokens for authentication. For more information, see [Authenticate to Azure DevOps using Microsoft Entra](../get-started/authentication/entra.md).
157+
154158
For more authentication samples, see [.NET Samples](../get-started/client-libraries/samples.md).
155159

156160
## Reference
@@ -190,7 +194,7 @@ async void InitAzureDevOps()
190194

191195
### Using NetStandard 2.0 versions of the Azure DevOps OM
192196

193-
For version 16.143.1 of our NuGet packages, we support NetStandard 2.0. These packages correlate with Azure DevOps Server 2019 RTW and are fully compatible with Azure DevOps.
197+
For version 16.143.1 of our NuGet packages, we support NetStandard 2.0. These packages correlate with Azure DevOps Server and are fully compatible with Azure DevOps.
194198

195199
### Microsoft.TeamFoundationServer.ExtendedClient package doesn't have NetStandard support
196200

0 commit comments

Comments
 (0)