azure-devops - 从公司 AD 中删除时删除 Azure DevOps 帐户
问题描述
从公司 AD 中删除帐户时,是否有自动(脚本或类似)方法从 Azure DevOps 中删除帐户订阅。今天,这是我们公司的一项手动工作,效率不高。
解决方案
如果要删除订阅的服务连接,可以使用一些 REST API。
步骤1。获取要删除连接的项目 ID
GET https://dev.azure.com/{organization}/_apis/projects/{projectName}?api-version=6.1-preview.4
第2步。获取项目中的服务连接id列表:Endpoints - Get Service Endpoints list
GET https://dev.azure.com/{organization}/{project}/_apis/serviceendpoint/endpoints?api-version=6.1-preview.4
或者您可以通过名称获取特定的服务连接 ID:Endpoints - Get Service Endpoints By Names:
GET https://dev.azure.com/{organization}/{project}/_apis/serviceendpoint/endpoints?endpointNames={endpointNames}&api-version=6.1-preview.4
Step3:删除服务连接:端点 - 删除:
DELETE https://dev.azure.com/{organization}/_apis/serviceendpoint/endpoints/{endpointId}?projectIds={projectIds}&api-version=6.1-preview.4
多个服务连接可以通过使用服务连接 id 作为{endpointId}
并重复此 REST API 来快速删除。
推荐阅读
- javascript - 带有拇指的轮播问题(react-id-swiper)
- javascript - 使用 CLI package.json 脚本时生产部署失败
- azure - 在 Azure 上规划 Kubernetes 集群
- java - 满足一定条件如何遍历节点列表并替换内容?
- android - 具有多个 Activity 的 Android 导航抽屉
- swift - 与视觉暂留相匹配的颜色选择 两种颜色混合
- ruby - Capybara / Ruby - 尝试仅从所有模棱两可的 css 选择器中获取文本并将其转换为字符串
- python - 从 Google Cloud Function 访问 SIFT
- javascript - 我可以扩展我的 div,但如何缩小它?
- laravel - 同时使用 web 和 token api gaurd 时的异常处理