0

Is there a way to setup an automatic change of access level in Azure DevOps after a specific number of days? E.g. Setup a rule that the access level is automatically changed from "Basic + Test Plans" to "Basic" after 30 days.

Best regards

Lillian Hjelmstad

1 Answers1

0

Please follow below steps to implement this requirement.

  1. 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.
  2. 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
        }
    }
]
  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.
  2. Create a yaml pipeline to run this API and set scheduled triggers using cron syntax.
Edward Han-MSFT
  • 2,879
  • 1
  • 4
  • 9