一个用于开发 AzureDevOps UI 扩展的新库可用,但我对发布部分有疑问
当我使用 api 版本时,我收到 401 错误,而我是我的项目和网站 azureDevOps 的管理员
import * as SDK from "azure-devops-extension-sdk";
import { CommonServiceIds, IProjectPageService, getClient } from "azure-
devops-extension-api";
import * as vsrelease from "azure-devops-extension-api/Release";
import * as vsbuild from "azure-devops-extension-api/Build";
await SDK.ready();
// get current project name
const projectService = await SDK.getService<IProjectPageService>(CommonServiceIds.ProjectPageService);
const project = await projectService.getProject();
let projectName = '';
if(project !== undefined) projectName = project.name;
console.log(projectName);
// get buildDefinitions = ok
const buildDefinitions = await getClient(vsbuild.BuildRestClient).getDefinitions(
projectName, undefined, undefined, undefined,
undefined, undefined, undefined, undefined, undefined,
undefined, undefined, undefined, true, true );
console.log(buildDefinitions);
// get releaseDefinitions == error 401 ??
// {"$id":"1","innerException":null,"message":"TF400813: The user 'my admin guid' is not authorized to access this resource.","typeName":"Microsoft.TeamFoundation.Framework.Server.InvalidIdentityException, Microsoft.TeamFoundation.Framework.Server","typeKey":"InvalidIdentityException","errorCode":0,"eventId":3000}
const releaseDefinitions = await getClient(vsrelease.ReleaseRestClient).getReleaseDefinitions(projectName);
console.log(releaseDefinitions);
https://github.com/Microsoft/azure-devops-extension-api/issues/2 https://github.com/Microsoft/azure-devops-extension-sdk/issues/3
我在github上没有答案
谢谢你的帮助。