Skip to content
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

Connect-ADO can throw errors but still can connect #150

Closed
dotnvo opened this issue Jul 25, 2022 · 1 comment · Fixed by #166
Closed

Connect-ADO can throw errors but still can connect #150

dotnvo opened this issue Jul 25, 2022 · 1 comment · Fixed by #166
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@dotnvo
Copy link

dotnvo commented Jul 25, 2022

When utilizing the command Connect-ADO with a scoped PAT, it seems to error out so it's not clear what the minimum permissions needed to connect without an error are. In some cases, perhaps not all, even though it throws an error, it still actually connects and returns an object.

Example: I created a PAT with a limited scope - specifically just for Work items (read, write, and manage) and encountered this error, but immediately was able to run get-adoproject:

image.

Commands I'd expect to work with my limited PAT, do work... like this:

Get-ADOProject -Project CCI | Get-ADOWorkItem -id 1

Other commands definitely failed with an unauthorized error, but that is expected as that token doesn't have those scopes. An example would be Get-ADOBuild in this case.

Obviously some commands won't work without a full access token but those will throw an error as seen above. Depending on the task a user wants to do, I would expect a limited PAT to work during the Connect-ADO process and not throw an error. If a user wanted to automate or only work on work items or some specific component using this module, they may choose to secure their tokens by limiting their scope. Perhaps the connection can be re-worked a tad to be more aware of the minimum necessary scope to do any task so as long as that minimum scope is met, it instead appears as successful connection instead of an error.

@StartAutomating StartAutomating self-assigned this Oct 18, 2022
@StartAutomating StartAutomating added bug Something isn't working enhancement New feature or request labels Oct 18, 2022
@StartAutomating
Copy link
Owner

@dotnvo This will be handled by adding a -NoCache parameter to Connect-ADO, which will not cache projects or teams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants