AzureDevOps - Your sign-in was successful but does not meet the criteria to access this resource

%3CLINGO-SUB%20id%3D%22lingo-sub-2554835%22%20slang%3D%22en-US%22%3EAzureDevOps%20-%20Your%20sign-in%20was%20successful%20but%20does%20not%20meet%20the%20criteria%20to%20access%20this%20resource%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2554835%22%20slang%3D%22en-US%22%3E%3CP%3ERecently%20I%20wanted%20to%20connect%20my%20Visual%20Studio%20to%20a%20remote%20AzureDevOps%20Git%20repository%20for%20cloning%20the%20project.%20This%20repo%20is%20in%20one%20of%20our%20client's%20DevOps%20organisation.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20able%20access%20the%20AzureDevOps%20portal%20and%20access%20the%20repository%20in%20the%20browser.%20But%20when%20I%20tried%20to%20connect%20my%20Visual%20Studio%20to%20Clone%20the%20git%20repo%20I%20got%20%3CSTRONG%3EYour%20sign-in%20was%20successful%20but%20does%20not%20meet%20the%20criteria%20to%20access%20this%20resource%20%3C%2FSTRONG%3Eerror%20while%20signing%20in.%20I%20got%20the%20same%20issue%20while%20cloning%20using%20the%20%3CEM%3Egit%20bash%3C%2FEM%3E.%3C%2FP%3E%3CP%3EThen%20I%20created%20a%20Personal%20Access%20Token%20(PAT)%20from%20the%20AzureDevOps%20portal%20and%20used%20the%20following%20powershell%20snippet%20to%20clone%20the%20repository.%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%24MyPat%20%3D%20'yourPAT'%0A%24B64Pat%20%3D%20%5BConvert%5D%3A%3AToBase64String(%5BSystem.Text.Encoding%5D%3A%3AUTF8.GetBytes(%22%3A%24MyPat%22))%0Agit%20-c%20http.extraHeader%3D%22Authorization%3A%20Basic%20%24B64Pat%22%20clone%20https%3A%2F%2Fdev.azure.com%2FyourOrgName%2FyourProjectName%2F_git%2FyourRepoName%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EI%20was%20able%20to%20successfully%20clone%20the%20repo%2C%20then%20I%20opened%20the%20solution%20in%20Visual%20Studio%20and%20from%20then%20onwards%20everything%20worked%20fine.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20anyone%20explain%20what%20could%20be%20the%20reason%20for%20this%20behaviour%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Recently I wanted to connect my Visual Studio to a remote AzureDevOps Git repository for cloning the project. This repo is in one of our client's DevOps organisation. 

 

I was able access the AzureDevOps portal and access the repository in the browser. But when I tried to connect my Visual Studio to Clone the git repo I got Your sign-in was successful but does not meet the criteria to access this resource error while signing in. I got the same issue while cloning using the git bash.

Then I created a Personal Access Token (PAT) from the AzureDevOps portal and used the following powershell snippet to clone the repository.

$MyPat = 'yourPAT'
$B64Pat = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(":$MyPat"))
git -c http.extraHeader="Authorization: Basic $B64Pat" clone https://dev.azure.com/yourOrgName/yourProjectName/_git/yourRepoName

I was able to successfully clone the repo, then I opened the solution in Visual Studio and from then onwards everything worked fine.

 

Can anyone explain what could be the reason for this behaviour?

0 Replies