azure-devops-dotnet-samples | Azure DevOps Services and Azure DevOps Server | Azure library
kandi X-RAY | azure-devops-dotnet-samples Summary
Support
Quality
Security
License
Reuse
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample Here
azure-devops-dotnet-samples Key Features
azure-devops-dotnet-samples Examples and Code Snippets
Trending Discussions on azure-devops-dotnet-samples
Trending Discussions on azure-devops-dotnet-samples
QUESTION
I'm trying to use the Azure DevOps Member Entitlement Management REST API to get a user by ID using the .NET Client.
I've set up a Personal Access Token (PAT) which includes Member Entitlement Management (Read) and Entitlements (Read), among other scopes.
When I call the Search endpoint I get a list of UserEntitlement
, but the GET endpoint throws the exception:
Access Denied: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx needs the following permission(s) on the resource Users to perform this action: ReadExtended Users
I don't know what this means... how do I add "ReadExtended Users" to the Users resource? I've looked through PAT scopes and user permissions and I can't find it.
Any why is it that I can list ALL users, but not get a single user by ID?? The documentation implies that the same permissions are required for both, and the returned objects are the same type (UserEntitlement).
Here's some code:
var uri = new Uri("https://vssps.dev.azure.com/MY_ORGANIZATION");
var credentials = new VssBasicCredential("", "PAT");
using (var connection = new VssConnection(uri, credentials))
using (var client = connection.GetClient())
{
return client.GetUserEntitlementAsync(new Guid("USER_ID")).Result;
}
I'm using v15.131.1 of the client API, .NET Fx 4.5.2. Yes, it a bit outdated but it's based on the Quickstart samples and the target project is .NET Fx.
ANSWER
Answered 2021-Aug-17 at 02:20Access Denied: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx needs the following permission(s) on the resource Users to perform this action: ReadExtended Users
I could reproduce this issue when run the User Entitlements - Get Rest API.
To solve this issue, you need to add the user to Project Collection Administrators Group in Organization Settings -> Permissions.
Then you could run the API successfully.
QUESTION
I am trying to get the list of users in ADO using .NET clients. I am referring to this git repository: https://github.com/microsoft/azure-devops-dotnet-samples/blob/master/ClientLibrary/Quickstarts/dotnet/GraphQuickStarts/Samples/EnumerateUsers.cs
I tried same thing but still the it shows error that GetUsersAsync needs assembly reference. I have used tried all the references. I am getting GetUserAsync but that is for one user. I need to fecth all the users. enter image description here
ANSWER
Answered 2020-Jun-22 at 06:28Instead of using GetUsersAsync
, please use ListUsersAsync
:
PagedGraphUsers users = graphClient.ListUsersAsync().Result;
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install azure-devops-dotnet-samples
Support
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesExplore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits
Save this library and start creating your kit
Share this Page