All Collections
Troubleshooting
Version control
Troubleshooting Azure DevOps connection
Troubleshooting Azure DevOps connection

Does your Azure DevOps connection give the error "Gearset can't find any repositories"?

Valerio Chang avatar
Written by Valerio Chang
Updated over a week ago

Are you having trouble with conencting Gearset to Azure DevOps?

When trying to load the repositories with Azure DevOps Git, do you receive the following error message.

Is Gearset is only able to show some, but not other, Azure organizations, and therefore you cannot access the repo you want? This document troubleshoots the common problems we see.

Cause 1 - Does your repo have a default branch?

We have seen repositories without a Default branch, that causes a problem with retrieval. In this screenshot the master branch is the default - please check your repo has one too.

If your repo does have a default branch, the API response (see cause 4 =) to

https://<accountName>.visualstudio.com/_apis/git/repositories?api-version=1.0

should have a the parameter "defaultBranch":"refs/heads/<branch name>". If it does not, we need to set a default branch.

Resolution

Set a branch (usually master or main) as default.

Cause 2 - Are you connected to the right tenant?

If you have multiple tenants in Azure DevOps, it is likely that that Gearset has been connected to the wrong one, and therefore can't load the repositories you expect. Gearset will give you the error:

"Gearset can't find any repositories. Either create one or update your security settings in Azure DevOps to grant access"

Alternatively, if you are using Pipelines, Gearset could be showing you a banner that says:

Pull requests can't be loaded and some of the pipeline functionality won't be available to you, please ask the owner for access.

To verify if you have multiple tenants, you can review it in the drop-down of your account's settings. To access this go to User settings and click on Profile :

Then click on the link to the Azure DevOps Profile Page :

Here you can review your tenants in the drop-down, make sure you have the right tenant selected.

(Note: If you do not have multiple tenants, it is possible that your repo type is not git-based. Gearset only supports Git repo types, and not other types such as TFVC. If your repo is not a Git repo type, you will need to create a new Git-based repo.)

Resolution

To resolve this, you need to:

  1. Switch your Azure DevOps to the correct tenant profile.

  2. In Gearset, delete the connection to Azure DevOps.

  3. Log out of Gearset to clear the cached credentials.

  4. Log into Gearset again and connect to Azure DevOps again. When you get the integration pop up, you can make sure that the part of the account / tenant in the parenthesis is correct.

You may need to log into an incognito window of your web browser to get the option to enter your desired Azure DevOps login details.

Cause 3: Can Gearset authenticate with OAuth?

If your Azure organization has not given permission for third-party access with OAuth, Gearset will not be able to retrieve repository data.

This will result in the error upon connection:


"Azure DevOps authorization error
A problem occurred while authorizing with AzureDev Ops.
โ€‹An unknown error occurred. Please contact support if you need assistance with this issue."

Resolution

  1. In Azure DevOps navigate to your Organization settings and in the left-hand menu click "Policies".

  2. Make sure that Third-party application access via OAuth is toggled to On.


This should allow you to see the right repositories that you are looking for.

Cause 4 - Can the API access the expected repos?

Check if you can access the list of repos via the API call in the URL to see what Gearset is able to see.

Start with this HTTP query in your browser to find the <publicAlias> value

https://app.vssps.visualstudio.com/_apis/profile/profiles/me?api-version=1.0

Then use this query to request for the <accountName>

https://app.vssps.visualstudio.com/_apis/Accounts?memberId=<publicAlias>&api-version=1.0

Finally, use this <accountName> to request for the list of repos available:

https://<accountName>.visualstudio.com/_apis/git/repositories?api-version=1.0

This can verify which repos are expected to show up in Gearset.

Did this answer your question?