简体   繁体   English

使用 Azure DevOps 获取个人访问令牌

[英]Getting Personal Access Token with Azure DevOps

I have C# code that pulls data from Azure DevOps On-premise that executes with a service account with no problems.我有 C# 代码,它从 Azure DevOps 内部提取数据,使用服务帐户执行没有问题。 The service account has Collection Admin Access through an AD Group.服务帐户通过 AD 组具有集合管理员访问权限。 My problem is the service account only needs read access.我的问题是服务帐户只需要读取权限。 What does the code look like to generate a PAT for the service account that limits the access to read only?为将访问权限限制为只读的服务帐户生成 PAT 的代码是什么样的?

From what I know this is not possible to create PAT programatically.据我所知,这是不可能以编程方式创建PAT的。 You can check also this question .你也可以检查这个问题 But if you want to define scope for PAT you can do at it's creation .但是,如果您想为PAT定义 scope,您可以在它的创建时进行。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM