Automating removal of user licenses.


In my opinion, this is a must. The logic is simple, you identify inactive users and either remove them or assign them a free Stakeholder license, and save money.

Tip 1 : There are several options from which you can choose to run the automation, below are some of them:


  1. As a script that you run manually.
  2. Automate using Azure Pipelines
  3. Automate using Azure Functions

Here is one of the approaches we are following, which makes use of Rest APIs for Azure DevOps and Azure Functions.
This is a graceful approach where the users will be notified about their license getting downgraded. They will also have the choice to login to ADO within a specified time to retain their license. The Axure Function is timer triggered - you can choose to keep the "notifying the users" logic and "removal" logic in the same function or separate functions.

During the notification flow:

  1. Get the list of users using ADO Rest API, and find the list of users who:
    • have not accesses in the last x days and
    • holds a Basic or Basic + Test Plans license type.
You can decide on the value of x, probably keep it somewhere around 30-45 days.

  1. Send an email out to these users saying that since they have not access ADO for x days, their license will be downgraded to Stakeholder. Also provide them an option to avoid the downgrade by giving them a buffer of a few days, within which they should login to ADO so that the last accessed date gets updated.

  1. Store the user list.

For the removal flow, :

  1. Check if the user list stored from step 3 in the first execution has users. If yes, then clean the list up, by either retaining their licenses if they had logged in during the buffer period or downgrading them to Stakeholder if they had not. The list will be empty by the end of this step.

  1. Get the next list of inactive users.

  1. Load the next set of inactive users to the list after sending them the warning emails.

This process continues.

Tip 2: Dealing Basic + Test Plan licenses separately.

Since the Basic + Test Plans license is way costlier compared to Basic, you can even think of downgrading them to Basic sooner.

There are some blog posts out there explaining how to do this. One of my colleagues is also working on putting a post together with the details, I'll add it here as soon as it goes live.

Cheers!

Comments

Popular posts from this blog

Azure DevOps - getting project stats for all projects

Export the members of a project level group from all the projects in an Azure DevOps

Managing user licenses and cost for Azure DevOps.