简体   繁体   English

Azure Devops Agent没有创建服务端点的权限(如何分配权限)

[英]Azure Devops Agent doesnt have permission to create a Service Endpoint (how do you allocate permissions)

As part of our release pipeline we're attempting to create a service endpoint using the rest api . 作为发布流程的一部分,我们尝试使用rest api创建服务端点 we're using a powershell script to call the endpoint. 我们正在使用Powershell脚本调用端点。 This script is run in a Powershell Pipeline Task. 该脚本在Powershell Pipeline Task中运行

在此处输入图片说明

To call the endpoint, we use the oAuth token provided to the Agent via the variable ( $env:SYSTEM_ACCESSTOKEN ) 要调用端点,我们使用通过变量( $env:SYSTEM_ACCESSTOKEN提供给代理的oAuth令牌。

在此处输入图片说明

by checking the agent configuration option: 通过检查代理配置选项:

在此处输入图片说明

Unfortunately, when the endpoint is called this token doesn't seem to have permission to create the service endpoint. 不幸的是,当端点被调用时,该令牌似乎没有创建服务端点的权限。 If i hard code my own PAT, this call succeeds. 如果我对自己的PAT进行硬编码,则此调用成功。

在此处输入图片说明

The Create Service Connection task is the powershell task that runs the script our powershell function Create-ServiceConnection from module file Vsts-ServiceConnection.psm1 创建服务连接任务是powershell任务,该任务运行脚本,该脚本来自模块文件Vsts-ServiceConnection.psm1我们的powershell函数Create-ServiceConnection。

The error message is very well descriptive but the difficulty is finding how do i allocate permissions that will be provided to the Agents oAuth token? 该错误消息具有很好的描述性,但困难在于查找如何分配将分配给代理oAuth令牌的权限?

UPDATE: 更新:

after finding this answer VSTS: Using System.AccessToken to create a service endpoint 找到此答案后VSTS:使用System.AccessToken创建服务端点

在此处输入图片说明

i added the permission to the "Project Collection Build Service" and it worked! 我将权限添加到“ Project Collection Build Service”中,并且它起作用了!

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从Azure DevOps发布到Azure App Service:“您无权查看此目录或页面” - Release from Azure DevOps to Azure App Service: "You do not have permission to view this directory or page" 拥有所有者权限时创建Azure DevOps项目的权限不足 - Insufficient permissions to create Azure DevOps project while having Owner permission 如何将Angular 6部署到Azure Web App - 您没有权限 - How to Deploy Angular 6 to Azure Web App - You do not have permissions 在Azure Devops中,添加一个state需要什么样的权限? - In Azure Devops, what kind of permissions do you need to add a state? Azure Devops由于权限原因无法以编程方式创建服务挂钩 - Azure Devops Unable to create service hook programatically due to permission DevOps Starter 不存在或您无权访问它 - The DevOps Starter does not exist or you do not have permission to access it 如何在 Azure DevOps 中创建服务帐户? - How to create service Account in Azure DevOps? 节点 JS 部署到 Azure Web 应用服务错误 - “您无权查看此目录或页面。” - Node JS Deployment to Azure Web App Service ERROR - "You do not have permission to view this directory or page." 在 Azure DevOps 中,如何在组织级别而不是项目级别创建 Azure 服务连接? - In Azure DevOps, how do I create an Azure Service connection at the organization level rather than the project? Azure:如何创建对内部端点的服务引用 - Azure: How to create a service reference to an internal endpoint
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM