microsoft / vss-web-extension-sdk

Visual Studio Teams Service Web Extension SDK
https://www.visualstudio.com/docs/integrate/extensions/overview
MIT License
133 stars 87 forks source link

Unable to make Get Service EndPoints Call from Dashboard Widget Configuration #141

Open akhanna38 opened 5 years ago

akhanna38 commented 5 years ago

Unable to make Get Service EndPoints Call from Dashboard Widget Configuration I am trying to get list of service endpoints in a dashboard widget configuration

import TFS_SE_Contracts = require("TFS/ServiceEndpoint/Contracts");
import TFS_SE_Client = require("TFS/ServiceEndpoint/ServiceEndpointRestClient");
const seClient = TFS_SE_Client.getClient();
const context: WebContext = VSS.getWebContext();
const serviceEndpoints: TFS_SE_Contracts.ServiceEndpoint[] = await seClient.getServiceEndpoints(context.project.id,"xyz");

However it keeps failing with this message TF400813: The user '51c243d4-a5d6-41f4-ad40-ded34ccd8530' is not authorized to access this resource. Guid shown here is not my user id but I get this guid everytime. This guid is not even present in WebContext. if another person tries, they get different guid.

dashboard widget has scope set up to vso.serviceendpoint_manage

akhanna38 commented 5 years ago

looks to be an issue with TFS 2018. it works with Azure DevOps on-prem