Authentication error cloning Azure Devop's repo in OS X - azure-devops

I have created a project in my Azure DevOps but when I try to clone it with Visual Studio Code or SourceTree it asks me for the password and the password I use is the one associated with my account, which is the Azure tenant administrator account with which I have logged into Azure DevOps and with which I have created the project.
but he always rejects me
I have the latest git version installed in OSX
Any idea, please?
Thanks

This should be related to the Git credential in your local, try to remove them and try again.
If it still does not work, you could use PAT(personal access token) to clone the repo, it should work.
git clone https://<Your-PAT-Here>#dev.azure.com/orgname/proname/_git/reponame

Related

Not able to bring Bitbucket repo to azure devops

I have generated the app password and took the clone URL correctly, although azure devops seems to be not recognizing. Please help , below are the screenshots with error
I can reproduce your issue:
To clone a repository, the app password should at least have
Repositories -> Read premission:
When importing the repository, the username should be your account
name rather than app password name.

Importing an existing local git repository into Azure Devops

My company has an old local git repository, which I'm trying to add to Azure Devops but so far, I've been unsuccessful (I've never setup a repository in Devops before, so I'm very new to this).
I've been trying to add this to devops by going into Repos > Import Repository, however when I attempt to import, I receive the following error:
I know this repository exists because I'm able to open this repository url via visual studio and work with the project within there, however when I attempt to import it into azure devops, I'm receiving that issue.
I've tried both providing authentication username & PAT....and I've attempted with no authentication. Neither seems to work.
Any idea what I'm doing wrong to get this imported into devops?
Thanks

Azure Visual Studio 2019 failed to push to Azure DevOps Git

Background
I have an Azure Synapse SQL server which have some tables and stored procedures. Visual Studio 2019 (VS2019) is connected to the SQL server using Active Directory Interactive Authentication with use name being a Service Account Email.
I have built a Azure DevOps Demo, with following setups (Organization, Project, Git Repository).
I have added the Service Account Email to the Azure DevOps project and repository level, with contributor access.
I am trying to synchronize the stored procedures with my Azure DevOps Repository.
I am able to use VS2019 > Team Explorer > Manage Connections, and set the Service Account Email as the "hosted repositories for", and see my Repositories appear in the list.
Problem
It turned out that when I try to push Git Changes, by Team Explorer > New Repository > Existing remote, where I entered the full URL of my repository https//dev.azure.com/%Organization%/%Project%/_git/%Repository%, following error turned up: Git failed with a fatal error. unable to access 'above URL': SSL certificate problem, unable to get local issuer certificate. How can I resolve this error?
How to push all of my existing stored procedures to my Repository?
Faced the same issue, requesting you to go through the link. Hope this will resolve the issue:
Authentication failed for https://xxx.visualstudio.com/DefaultCollection/_git/project

How do I know which git authentication method is being used?

Is there a way to verify through which way I'm authenticating to Azure DevOps?
Am I authenticating through my SSH key?
Am I authenticating through Azure CLI?
Am I authenticating through Azure Account extension in VSCode?
I found setting GIT_TRACE=1 to be useful for debugging Git. (I found that from this page.)
git config --list --show-origin will also show if you're configured to use any credential.helper such as Git Credential Manager Core.
For git authentication with Azure DevOps, the first thing I'd do is to run
git remote show origin
If the Fetch and Push URLs start with git:, you're using an SSH key. If it starts with https:, it's going to do an OAuth browser login to Azure DevOps, and then display a message telling you that you're signed in and can close the browser window, at which point Git will have the credential it needs to work with the remote repository. In my experience, it works the same way in VS Code - it uses whatever credential the Git application has negotiated.
The Azure CLI should not come into play with Git - it can be used to manipulate Azure DevOps features, but does not participate directly in the source control process (other than allowing things like PR submission, etc.)

Azure Devops clone This is not a valid source path in source tree

I have managed to finally add my devops account in sourcetree using the https://orgname.visualstudio.com path
Now I am having issues cloning the repository
I am using the path that devops gives me
https://orgname#dev.azure.com/orgname/MyProject/_git/MyRepo
but I get an error saying
This is not a valid source
The details reveal authentication issues... Yet it authenticated fine when adding the account.
What is going on? Does the azure account have to be the default account?
I managed to fix this by changing from the sourcetree embedded git to my system git Tools>Options>Git>Git Version>Select System. Afterwards when trying again it prompted me to login on my organization domain with 2 factor as if logging in on the devops web app directly.
My system Git is using manager-core for the credential management which is probably not the same system which the embedded version used.
I tried the above solutions (and more) but for me what in the end solved the problem was that the git-password I first wrongly entered when I tried to access the repo had been saved in Keychain (MacOS) and when I tried again this password was used without giving me the option to type it in again. I deleted the password to the Azure DevOps project in Keychain and then got prompted to enter the password again whereafter I pasted the Personal Access Token (!!) generated in Azure Devops and it finally worked!
It could happen when you entered wrong credentials and you don't get asked again, try this:
Go to : Sourtree->Preferences->Advance (tab)
Under: "Default usernames for URLs which do not include one:" delete your wrong credentials.
Try accessing your repo again with right credentials.
This is not the issue which caused by Azure devops. No matter https://xxx.visualstudio.com, or the URL which like dev.azure.com, they should all available git source.
For me, I just try with multi different git URLs, and found the few of URLs are failed with same error with you. But it prompt This is a git repository after I exit the SourceTree and re-configure the clone with same URL which encountered the error previously.
This seems be the most common Sourcetree problem which encountered by many users, not just the URL of azure devops that you occurred.
Check this thread, and try with its recommend way:
Open source tree, Tools -> Options -> Click on Git Tab -> Update
Embedded Git.
Or, consider the method I used: exit the Sourcetree, and re-configure the clone with same URL. (Not recommend since this can not permanently solve this issue)