-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testconsole: 401 Unauthorised when attempting to retrieve automated test runs #1420
Comments
These are the permissions I've given my PAT:
|
There is a very recent document about how Microsoft have added PAT scopes to the API and documented them. That said, it is not obvious which scope is missing. The first step is to find the actual API call being used by the SDK, or just use a process of elimination. There is as you say the option to gracefully handle the 401, or a technique I have used before is to add a flag to disable the call to get the test data. |
Thanks @rfennell . The Azure DevOps API docs don't appear to cover this particular API call ( |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
@dave-sampson13 Thank you for the work around. Bumping as this is still an issue. |
I will move this to be a known issue, I fear we are still limited by what PATs are 'setable' |
Awesome task!
I'm using the
testconsole
to test my configuration & handlebars template. If I issue myself a PAT with full access, everything works fine. However, if I attempt to restrict the permissions in the PAT to those I would expect it to need, it only goes so far before encountering a 401 Unauthorised when attempting to retrieve details of automated test runs (there are none in my project, by the way), which then seemingly causes it to lose all the work items it had previously successfully retrieved, and consequently the markdown file produced is largely empty.I tracked the issue down to
AzurePipelines/Extensions/XplatGenerateReleaseNotes/V3/ReleaseNotesFunctions.ts
Line 542 in 1ca0b2c
AzurePipelines/Extensions/XplatGenerateReleaseNotes/V3/ReleaseNotesFunctions.ts
Line 550 in 1ca0b2c
testAPI.getTestResultsByBuild
and hates me & the PAT I rode in on.The doco is fairly limited on what access this extension method & the APIs it calls needs, so running a bit blind, but my work-around for now has been to comment out the majority of this function (because I don't have any automated tests anyway), and then everything works just fine. Ideally though I wouldn't need to do that, & instead it'd be good to:
testconsole
needs so I don't need to create a PAT with full access (indeed some Azure DevOps organisations I work with don't even allow the creation of full access PATs)Thanks for your help, let me know if you need any more information!
The text was updated successfully, but these errors were encountered: