問題描述
在 Azure DevOps 中自動更改用戶的訪問級別 (Automatically change access level on a user in Azure DevOps)
有沒有辦法在特定天數後在 Azure DevOps 中設置訪問級別的自動更改?例如,設置訪問級別從“基本 + 測試計劃”自動更改的規則。到“基本” 30 天后。
最好的問候
Lillian Hjelmstad
參考解法
方法 1:
Please follow below steps to implement this requirement.
- Use this Reset API: User Entitlements ‑ Get User Entitlements to get a paged set of user entitlements, and then find the
id
of target user. - Use this Rest API: User Entitlements ‑ Update User Entitlement to update target user's access level. And the following request body(
Content‑Type: application/json‑patch+json
) will change the access level to Basic.
[
{
"from":"",
"op":2,
"path":"/accessLevel",
"value":{
"accountLicenseType":2,
"licensingSource":1
}
}
]
- To success to call this API, you should authenticate with identity as a Project Collection Administrator or an organization Owner. You could create a PAT with full access.
- Create a yaml pipeline to run this API and set scheduled triggers using cron syntax.
(by Lillian Hjelmstad、Edward Han‑MSFT)