1
votes

Is it possible to pull work items from the DevOps API without needing a user to be logged in to get an access token every time?

I am trying to create a back-end service that pulls work items from the API every so often to generate a report. Can I just generate a one-time access key to use with that back-end service?

I've looked around the documentation, but it seemed like it all requires either a PAT or Azure Active Directory authorization/authentication.

Here's the docs for the API: Link

2
I know that a PAT will expire eventually, but why don't you consider that to be a "one-time access key"? - Crowcoder
@Crowcoder yeah I guess my wording was off. A PAT is a one-time access key, but I need something that won't expire so I don't have to keep generating a new one. I don't believe there is a way to do that programmatically without some sort of user interaction. - ForgotMyName

2 Answers

0
votes
0
votes

Instead of your personal account, you could create a fake AAD user then add it to your Azure DevOps Service.

Use that account to create a Personal Access Token. Similar to Build Service account to pull source code/work items. This should be a easy way to track everything.

But the limitation here is also obvious: this needs involvement of IT department, and also causes additional costs, since every user is billed.


Allow personal access tokens that do not expire is not supported right now. There is a related user voice.

As an alternatively way you could use OAuth just as alphaz18 suggested. Details please refer-- Authorize access to REST APIs with OAuth 2.0