c# - 无法在 Azure DevOps 2019 通过代码(无权限)创建代理池
问题描述
我问有关通过 c# 创建代码的问题:this。
所以,我的代码是:
var _tfsUrl = "http://mytfs.domain.local:8080/tfs/Collection_Name/";
VssCredentials c = new VssCredentials(new WindowsCredential());
using (var connection= new VssConnection(new Uri(_tfsUrl), c))
{
var client = connection.GetClient<TaskAgentHttpClient>();
var agentPools = client.GetAgentPoolsAsync().Result;
var result = client.AddAgentPoolAsync(new TaskAgentPool("Auto test pool_1")).Result; //error !
}
但我没有权限:
System.AggregateException: 'Web method running: [http://mytfs.domain.local:8080/tfs/Collection_Name/_apis/distributedtask/pools] (POST)pools[distributedtask] E2EId: some_uid'
AccessDeniedException: Access denied. 'UserName' needs Manage permissions to perform the action. For more information, contact the Azure DevOps Server administrator.
所以,我尝试手动创建代理池,它可以工作!
我的用户名在“代理池-> 安全”中具有管理权限。
我的角色是:构建管理员、项目管理员、发布管理员。
你能告诉我,如何解决这个问题吗?谢谢!
解决方案
推荐阅读
- exchangewebservices - EWS API 未返回 MS Teams 对话的来宾用户的显示名称
- python - Python 子进程:根据前一个命令的输出向进程发送一系列命令
- hadoop - 将 Hive 事务表迁移到另一个云平台
- python - 学生寻求编程建议
- wordpress - 做重力形式 | 最好的 WordPress 表单插件 | 表单生成器支持提交前预览
- android - 适用于 iOS 和 Android 应用程序的 Amazon Textract
- python - 在 selenium 中无法通过 xpath 定位元素?
- python - ARIMA 模型中的负面结果
- puppet - 为什么 Puppet 模块的主类会包含在子类中?
- javascript - JavaScript 不加载元素