且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在VSTS Graph api组列表查询中使用scopeDescriptor和subjectTypes?

更新时间:2023-02-21 08:25:40

您可以通过向 https://vssps.dev.azure.com/发出api请求来获取项目或集合的范围描述符.{organization}/_ apis/graph/descriptors/{Id} (如果要获取项目的范围描述符,请用projectId替换ID.

You can get the scope descriptors for a project or a collection by making an api request to https://vssps.dev.azure.com/{organization}/_apis/graph/descriptors/{Id}(replace id with projectId if you want to get the scope descriptor for a project and so on).

例如,如果要获取项目的范围描述符,则只需将请求URL中的存储密钥替换为项目ID,并作为响应即可获得范围描述符.范围描述符具有以下格式scp.(长唯一标识符).

For example if you want to get the scope descriptor for a project then simply replace the storage key in the request URL with the project Id and in response you get the scope descriptor. The scope descriptor has the following format scp.(long unique identifier).

PS:有关如何获取描述符的更多信息,请参见

P.S: More on how to get descriptors can be found here https://docs.microsoft.com/en-us/rest/api/azure/devops/graph/descriptors/get?view=azure-devops-rest-5.0. Remember storagekey can be substituted with projectid or collectionid to get specific descriptors.