Closed Moeahmad94 closed 5 years ago
This is the main error I'm getting:
{"Error converting value \"Microsoft.IdentityModel.Claims.ClaimsIdentity;72f988bf-86f1-41af-91ab-2d7cd011db47\moahm@microsoft.com\" to type 'Microsoft.VisualStudio.Services.Identity.IdentityDescriptor'. Path 'authenticatedUser.descriptor', line 1, position 184."}
I updated the original post to reflect this.
Have you tried connecting directly to the REST Endpoint and not using the client library?
I have not. Do you mean for Auth only, or for everything?
+1 Also having this issue with Azure Functions and the client libraries.
For everything. I am not sure if we support the client libs for Azure functions. But you can certainly use direct HTTP calls to the REST endpoints.
Please let me know how it goes.
Also, feel free to add a suggestion ticket if this becomes a priority for you
@danhellem it doesn't work on Functions v1. Client Libraries (beta) don't work on v2 either given their dependencies on Microsoft.Net.Http (2.2.29) and Microsoft.Bcl (1.1.10) which don't have .NET Core equivalents.
If it's an issue with the Functions runtime I'm not sure it would be in scope for the suggestions link you've added above, but deprecating the two dependencies noted above in favor of packages not explicitly targeting the .NET Framework would help tremendously.
I should note that the workaround as described here does work, but ideally this wouldn't be necessary:
Specifically:
- Register the type converters for those types by type name only:
TypeDescriptor.AddAttributes(typeof(IdentityDescriptor), new TypeConverterAttribute(typeof(IdentityDescriptorConverter).FullName));
TypeDescriptor.AddAttributes(typeof(SubjectDescriptor), new TypeConverterAttribute(typeof(SubjectDescriptorConverter).FullName));
I added this just before the line where I create the VssConnection object.
Hi, I'm trying to use your GitClient to update a repository via an Azure Function, but I'm having issues with the Auth aspect of it. I'm trying to use a personalAccessToken and am following the example shown here: https://github.com/Microsoft/vsts-dotnet-samples. Specifically I'm trying to use the following:
Connection = new VssConnection(new Uri(c_CollectionUri), new VssBasicCredential(string.Empty, personalAccessToken)); GitClient = Connection.GetClient();
This keeps failing on the GitClient = ... line. personalAccessToken is my personalAccessToken, and c_CollectionUri is "https://microsoft.visualstudio.com/DefaultCollection".
I also tried the following from https://docs.microsoft.com/en-us/azure/devops/integrate/get-started/client-libraries/samples?view=vsts but still got an error (a different error than the other method though:
Connection = new VssConnection(new Uri(c_CollectionUri), new VssAadCredential());
Am I doing something wrong, or should I be using a different form of authentication for this? This is one of the errors I am getting:
{"Error converting value \"Microsoft.IdentityModel.Claims.ClaimsIdentity;72f988bf-86f1-41af-91ab-2d7cd011db47\moahm@microsoft.com\" to type 'Microsoft.VisualStudio.Services.Identity.IdentityDescriptor'. Path 'authenticatedUser.descriptor', line 1, position 184."}
Thanks, Moe