You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//============= Config [Edit these with your settings] =====================
14
-
internalconststringvstsCollectionUrl="https://myaccount.visualstudio.com";//change to the URL of your VSTS account; NOTE: This must use HTTPS
14
+
internalconststringazureDevOpsOrganizationUrl="https://dev.azure.com/organization";//change to the URL of your Azure DevOps account; NOTE: This must use HTTPS
15
15
// internal const string vstsCollectioUrl = "http://myserver:8080/tfs/DefaultCollection" alternate URL for a TFS collection
Copy file name to clipboardExpand all lines: ClientLibraryConsoleAppSample/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
# Client Libraries Sample
2
2
3
-
For native applications the best way to authenticate and access VSTS resources is using the [Client Libraries](https://www.visualstudio.com/en-us/docs/integrate/get-started/client-libraries/dotnet). They are .NET libraries made to simplify integration with Visual Studio Team Services and Team Foundation Server (2015 and later). They allow access to both the Traditional Client Object Model and [new REST APIs](https://www.visualstudio.com/en-us/docs/integrate/api/overview).
3
+
For native applications the best way to authenticate and access Azure DevOps resources is using the [Client Libraries](https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/dotnet-client-libraries?view=vsts). They are .NET libraries made to simplify integration with Azure DevOps and Team Foundation Server (2015 and later). They allow access to both the Traditional Client Object Model and [new REST APIs](https://docs.microsoft.com/en-us/rest/api/vsts/?view=vsts-rest-4.1).
4
4
5
5
## Sample Application
6
6
7
-
This buildable sample will walk you through the steps to create an application which uses the [Client Libraries](https://www.visualstudio.com/en-us/docs/integrate/get-started/client-libraries/dotnet) to open an interactive login prompt and use that authentication state to execute a user pre-defined query written in [Work Item Query Language](https://msdn.microsoft.com/en-us/library/bb130198(v=vs.90).aspx). Query results are output into the console.
7
+
This buildable sample will walk you through the steps to create an application which uses the [Client Libraries](https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/dotnet-client-libraries?view=vsts) to open an interactive login prompt and use that authentication state to execute a user pre-defined query written in [Work Item Query Language](https://msdn.microsoft.com/en-us/library/bb130198(v=vs.90).aspx). Query results are output into the console.
8
8
9
9
## Step 1: Clone or download vsts-auth-samples repository
2. Use [Nuget package restore](https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore) to ensure you have all dependencies installed
20
20
3. Open the solution file `ClientLibraryConsoleAppSample.csproj` in [Visual Studio 2017](https://www.visualstudio.com/downloads/)
21
21
4. Open CS file `Program.cs` and there is a section with input values to change at the top of the class:
22
-
*`vstsCollectionUrl` - Mutable value. This is the url to your VSTS/TFS collection, e.g. http://myaccount.visualstudio.com for VSTS or http://myserver:8080/tfs/DefaultCollection for TFS.
23
-
5. Build and run solution. After running you should see a list of the IDs all work items which match your query restrictions.
22
+
*`azureDevOpsOrganizationUrl` - Mutable value. This is the url to your Azure DevOps/TFS collection, e.g. http://dev.azure.com/organization for Azure DevOps or http://myserver:8080/tfs/DefaultCollection for TFS.
23
+
5. Build and run solution. After running you should see a list of the IDs all work items which match your query restrictions.
For native applications the best way to authenticate and access VSTS resources is using the [Client Libraries](https://www.visualstudio.com/en-us/docs/integrate/get-started/client-libraries/dotnet). They are .NET libraries made to simplify integration with Visual Studio Team Services and Team Foundation Server (2015 and later). They allow access to both the Traditional Client Object Model and [new REST APIs](https://www.visualstudio.com/en-us/docs/integrate/api/overview).
3
+
For native applications the best way to authenticate and access Azure DevOps resources is using the [Client Libraries](https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/dotnet-client-libraries?view=vsts). They are .NET libraries made to simplify integration with Azure DevOps and Team Foundation Server (2015 and later). They allow access to both the Traditional Client Object Model and [new REST APIs](https://docs.microsoft.com/en-us/rest/api/vsts/?view=vsts-rest-4.1).
4
4
5
5
## Sample Application
6
6
7
-
This buildable sample will walk you through the steps to create an application which uses the [Client Libraries](https://www.visualstudio.com/en-us/docs/integrate/get-started/client-libraries/dotnet) and a personal access token to execute a user pre-defined query written in [Work Item Query Language](https://msdn.microsoft.com/en-us/library/bb130198(v=vs.90).aspx). Query results are output into the console.
7
+
This buildable sample will walk you through the steps to create an application which uses the [Client Libraries](https://docs.microsoft.com/en-us/azure/devops/integrate/concepts/dotnet-client-libraries?view=vsts) and a personal access token to execute a user pre-defined query written in [Work Item Query Language](https://msdn.microsoft.com/en-us/library/bb130198(v=vs.90).aspx). Query results are output into the console.
8
8
9
9
## Step 1: Clone or download vsts-auth-samples repository
1. Generate a [PAT token](https://docs.microsoft.com/en-us/vsts/organizations/accounts/use-personal-access-tokens-to-authenticate?view=vsts) and grant it "Work items (read)" permission and make a copy of the generated value
18
+
1. Generate a [PAT token](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=vsts) and grant it "Work items (read)" permission and make a copy of the generated value
19
19
2. Navigate to the sample in cloned repo `vsts-auth-samples/ClientLibraryPatAppSample/`
20
20
3. Use [Nuget package restore](https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore) to ensure you have all dependencies installed
21
21
4. Open the solution file `ClientLibraryPatAppSample.csproj` in [Visual Studio 2017](https://www.visualstudio.com/downloads/)
22
22
5. Open CS file `Program.cs` and there is a section with input values to change at the top of the class:
23
-
*`vstsCollectionUrl` - Mutable value. This is the url to your VSTS/TFS collection, e.g. http://myaccount.visualstudio.com for VSTS or http://myserver:8080/tfs/DefaultCollection for TFS.
23
+
*`azureDevOpsOrganizationUrl` - Mutable value. This is the url to your Azure DevOps/TFS organization/collection, e.g. http://dev.azure.com/organization for Azure DevOps or http://myserver:8080/tfs/DefaultCollection for TFS.
24
24
*`pat` - Mutable value. This is the value you generated in step 1.
25
25
6. Build and run solution. After running you should see a list of the IDs all work items which match your query restrictions.
Copy file name to clipboardExpand all lines: DeviceProfileSample/README.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,15 @@ For a headless text output client application, it is not possible authenticate t
6
6
7
7
This buildable sample will walk you through the steps to create a client-side console application which uses ADAL to authenticate a user via the [Device Profile flow](https://azure.microsoft.com/en-us/resources/samples/active-directory-dotnet-deviceprofile/?v=17.23h) and returns a JSON string containing all account team project data viewable by the authenticated user.
8
8
9
-
To run this sample for an [Azure Active Directory](https://docs.microsoft.com/en-us/azure/active-directory/active-directory-whatis) backed VSTS account you will need:
9
+
To run this sample for an [Azure Active Directory](https://docs.microsoft.com/en-us/azure/active-directory/active-directory-whatis) backed Azure DevOps account you will need:
10
10
*[Visual Studio IDE](https://www.visualstudio.com/vs/)
11
11
* An Azure Active Directory (AAD) tenant. If you do not have one, follow these [steps to set up an AAD](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-howto-tenant)
12
12
* A user account in your AAD tenant
13
-
* A VSTS account backed by your AAD tenant where your user account has access. If you have an existing VSTS account not connected to your AAD tenant follow these [steps to connect your AAD tenant to your VSTS account](https://www.visualstudio.com/en-us/docs/setup-admin/team-services/manage-organization-access-for-your-account-vs)
13
+
* A Azure DevOps account backed by your AAD tenant where your user account has access. If you have an existing Azure DevOps account not connected to your AAD tenant follow these [steps to connect your AAD tenant to your Azure DevOps account](https://www.visualstudio.com/en-us/docs/setup-admin/team-services/manage-organization-access-for-your-account-vs)
14
14
15
-
To run this sample for a [Microsoft Account](https://account.microsoft.com/account) backed VSTS account you will need:
15
+
To run this sample for a [Microsoft Account](https://account.microsoft.com/account) backed Azure DevOps account you will need:
16
16
*[Visual Studio IDE](https://www.visualstudio.com/vs/)
17
-
* A VSTS account not connected to AAD
17
+
* A Azure DevOps account not connected to AAD
18
18
19
19
## Step 1: Clone or download vsts-auth-samples repository
## Step 2: Register the sample application with you Azure Active Directory tenant (AAD backed VSTS account)
26
+
## Step 2: Register the sample application with you Azure Active Directory tenant (AAD backed Azure DevOps account)
27
27
28
28
```no-highlight
29
-
If you are a Microsoft Account backed VSTS account please skip this step.
29
+
If you are a Microsoft Account backed Azure DevOps account please skip this step.
30
30
```
31
31
32
32
1. Sign in to the [Azure Portal](https://portal.azure.com).
@@ -35,27 +35,27 @@ If you are a Microsoft Account backed VSTS account please skip this step.
35
35
4. Click on `App registrations` and select `New application registration` from the top bar.
36
36
5. Enter a `name` for you application, ex. "Adal native app sample", choose `Native` for `application type`, and enter `http://adalsample` for the `Redirect URI`. Finally click `create` at the bottom of the screen.
37
37
6. Save the `Application ID` from your new application registration. You will need it later in this sample.
38
-
7. Grant permissions for VSTS. Click `Required permissions` -> `add` -> `1 Select an API` -> type in and select `Microsoft Visual Studio Team Services` -> check the box for `Delegated Permissions` -> click `Select` -> click `Done` -> click `Grant Permissions` -> click `Yes`.
38
+
7. Grant permissions for Azure DevOps. Click `Required permissions` -> `add` -> `1 Select an API` -> type in and select `Azure DevOps` -> check the box for `Delegated Permissions` -> click `Select` -> click `Done` -> click `Grant Permissions` -> click `Yes`.
39
39
40
40
## Step 3: Install and configure ADAL (optional)
41
41
42
42
Package: `Microsoft.Identity.Model.Clients.ActiveDirectory` has already been installed and configured in the sample, but if you are adding to your own project you will need to [install and configure it yourself](https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory).
43
43
44
-
## Step 4a: Run the sample (AAD backed VSTS account)
44
+
## Step 4a: Run the sample (AAD backed Azure DevOps account)
45
45
46
46
1. Navigate to the sample in cloned repo `vsts-auth-samples/DeviceProfileSample/`
47
47
2. Open the solution file `DeviceProfileSample.sln` in [Visual Studio 2017](https://www.visualstudio.com/downloads/)
48
48
3. Use [Nuget package restore](https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore) to ensure you have all dependencies installed
49
49
4. Open CS file `Program.cs` and there is a section with input values to change at the top of the class:
50
-
*`vstsCollectionUrl` - Update this value to your VSTS collection URL, e.g. http://myaccount.visualstudio.com.
50
+
*`azureDevOpsOrganizationUrl` - Update this value to your VSTS collection URL, e.g. http://dev.azure.com/organization.
51
51
*`clientId` - Update this value with the `Application ID` you saved in step 2.6.
52
52
5. Build and run solution. You should see a console window with instructions on how to authenticate via the Device Profile flow. After authenticating you should see all team project information viewable by the authenticated identity displayed in the console window.
53
53
54
-
## Step 4b: Run the sample (Microsoft Account backed VSTS account)
54
+
## Step 4b: Run the sample (Microsoft Account backed Azure DevOps account)
55
55
56
56
1. Navigate to the sample in cloned repo `vsts-auth-samples/DeviceProfileSample/`
57
57
2. Open the solution file `DeviceProfileSample.sln` in [Visual Studio 2017](https://www.visualstudio.com/downloads/)
58
58
3. Use [Nuget package restore](https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore) to ensure you have all dependencies installed
59
59
4. Open CS file `Program.cs` and there is a section with input values to change at the top of the class:
60
-
*`vstsCollectionUrl` - Update this value to your VSTS collection URL, e.g. http://myaccount.visualstudio.com.
61
-
5. Build and run solution. You should see a console window with instructions on how to authenticate via the Device Profile flow. After authenticating you should see all team project information viewable by the authenticated identity displayed in the console window.
60
+
*`azureDevOpsOrganizationUrl` - Update this value to your VSTS collection URL, e.g. http://dev.azure.com/organization.
61
+
5. Build and run solution. You should see a console window with instructions on how to authenticate via the Device Profile flow. After authenticating you should see all team project information viewable by the authenticated identity displayed in the console window.
0 commit comments