【问题标题】:How to fix endpoint where Endpoint Administrators lost privileges by accident?如何修复端点管理员意外失去权限的端点?
【发布时间】:2020-05-01 01:41:32
【问题描述】:

我错误地从 Azure DevOps Server 2019 中的服务连接端点删除了 Endpoint Administrators 组权限。因此,即使我是项目管理员,我也失去了对该端点的管理权限。我在该端点上看不到具有管理员角色的用户。端点的创建者未列在其余用户中。

docs of service connections 没有帮助。我尝试询问 Team Foundation Administrators 组中的同事,但他也看到“添加”按钮被禁用,因此他无法重新添加该组。

我是否必须重新创建端点并更改所有管道才能使用新的?或者有没有办法修复旧的?

【问题讨论】:

    标签: azure-pipelines azure-devops-server-2019


    【解决方案1】:

    我是否必须重新创建端点并更改所有要使用的管道 新的?

    不,不确定您收藏中的权限配置,因为即使我不是项目管理员,我也可以。但是作为Project Collection Administrators 成员的用户(注意,此成员必须是 Project Collection Administrators 的成员)可以轻松完成此操作。


    如果还是不合适,试试下面的api添加:

    PUT https://{instance}/{collection}/_apis/securityroles/scopes/distributedtask.serviceendpointrole/roleassignments/resources/{project id}_{resource id}
    

    请求正文:

    [{"roleName":"Administrator","userId":"abxxxxxxxf8f7"}]
    

    关键点:

    {project id}_{resource id}:资源后面的这个参数是project idresource id组合。对于project id,您可以通过此one 捕捉到它。而对于resource id,您可以在单击该特定服务连接时直接从 URL 空白中获取它。

    userId:这是Endpoint Administrators的id。在https://{instance}/{collection}/{project}/_settings/security的页面点击这个群,你可以从F12获取。

    【讨论】:

    • 我在登录时从浏览器控制台尝试了我的帐户下的 API 调用。结果是 403 响应。
    • {"$id":"1","customProperties":{"Descriptor":"System.Security.Principal.WindowsIdentity;{sid}","IdentityDisplayName":"{name}","Token":"endpoints/{proj id}/{ep id}","RequestedPermissions":2,"NamespaceId":"49b48001-ca20-4adc-8111-5b60c903a50c"},"innerException":null,"message":"Access Denied: {name} needs the following permission(s) on the resource endpoints/{proj id}/{ep id} to perform this action: Administer Endpoint","typeName":"Microsoft.VisualStudio.Services.Security.AccessCheckException, Microsoft.VisualStudio.Services.WebApi","typeKey":"AccessCheckException","errorCode":0,"eventId":3000}
    • 会和同事一起尝试。刚刚向他发送了我用来执行请求的代码(使用登录用户从 Google Chrome 控制台执行的 Fetch API 调用)。
    • @Palec,好吧.. 如果您使用的是 VSTS,我们的团队可能会帮助您从后端添加管理员。但它是 TFS,你可以尝试联系 TFS 服务器所在机器的管理员。并建议这个人去做。
    • @Palec.是的,我看到了。我希望它是 VSTS,以便我可以直接提供帮助。我不确定创建者是如何从您这边的此端点中删除的。恐怕您最好创建新的端点,尽管这会很麻烦,因为需要更改很多管道。我需要建议,请在这里至少保留一个端点角色,例如创建者。
    猜你喜欢
    • 2020-09-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-08
    • 1970-01-01
    • 2017-09-28
    • 1970-01-01
    相关资源
    最近更新 更多