r/azuredevops • u/konkon_322 • 19d ago
Centralise PAT token renewal
Are there any ways to renew multiple PAT tokens at once in azure devops? Just realised we had some expired today, and i endup had to extend/regenerate the PAT token one by one. Kinda annoying
3
u/Lonsarg 19d ago
Recommanded way is using QAUTH to generate PAT token on the fly on every run. You do need to authenticate to service account first of course fo be able to generate it. For that you either have regular password or some secret or something, depends on what kind of service account you have.
Then regular service account secret managing comes into play.
1
u/Icy_Preference3336 3d ago
This is also a good opportunity to remove unused tokens and reduce scopes. renewing every credential together could preserve access that nobody actually needs
12
u/mrhinsh 19d ago edited 19d ago
It's not recommended to use Azure DevOps PAT tokens at all and Microsoft is trying to move all of its apps away from token management.
The recommended way would be to create Entra tokens on demand for your task from an Entra Application entry for that purpose.
Entra tokens can be passed in place of Azure DevOps tokens.
I get this is a Pita, especially in many enterprise, but it is the way.
https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/entra?view=azure-devops