私はc#を介してコードを作成することについて質問します:これ。
だから、私のコードは次のとおりです。
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.
だから、私はエージェントプールを手動で作成しようとしました、そしてそれはうまくいきます!
私のユーザー名には、「エージェントプール->セキュリティ」の管理者権限があります。
私の役割は、ビルド管理者、プロジェクト管理者、リリース管理者です。
これを解決する方法を教えていただけますか?ありがとうございました!
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加