huserben / TfsExtensions

Extensions for TFS 2015+ such as custom Widgets (require TFS 2017) and Build Tasks
MIT License
44 stars 22 forks source link

Could not access projects - you're version of TFS might be too old. #216

Closed MarkLFT closed 1 year ago

MarkLFT commented 2 years ago

When I use the current version of Trigger Build on the current Azure DevOps cloud system, I receive an error: Could not access projects - your version of TFS might be too old, please check online for help.

The called build job is in the same organisation but a different repo. I have tried calling it using the name, and the ID. Both give the same result.

Does this still work on the latest version of Azure DevOps?

huserben commented 2 years ago

Hi @MarkLFT

did the task ever work for you and now suddenly stopped working? Or is this your first try of using it?

I've not heard anything about breaking compatibility, so it should work (I would imagine others complaining as well if that were the case).

This message sounds like some sort of access problem - what authentication method are you using? If you use OAuth, does the "build service user" have the required rights to access the different repos/team projects? Could you use to test a Personal Access Token and run it with your user rights to see whether that solves the problem (so we can narrow down on the root cause)?

MarkLFT commented 2 years ago

Many thanks for getting back to me so promptly.

This is the first time of using this tool, so it is most probable I am doing something wrong.

I will create a PAT and try that to see if it helps.

Yes, this account has full access to all projects, builds etc. I only have a single account for all my repositories.

Will let you know how I go on using the PAT.

MarkLFT commented 2 years ago

Using the PAT worked.

So, what did I do wrong using the oAuth? What step did I miss?

huserben commented 2 years ago

Ok thanks for checking this.

So assuming the repo is in the same team project, I think you could set up the necessary rights in the "Repositories" section of the settings: Repo Settings

When OAuth is used, it will run the operation for the Build Service, so my advice is to check these settings (sorry I don't have much experience which settings would need to be set - but perhaps you can try with enabling all and see if this works and if so gradually reduce the rights...).

If it's in a different team project the same approach might work, but I'm not sure. I think worst-case you might need to use your PAT and run it for your user instead.