Unauthorized Response from Azure DevOps - azure-devops

Our client is using for Azure DevOps for code repository. I've been able to connect and pull/push code for a year without issue.
I started on a new project for this client that uses the ADO Artifacts for a NuGet store. My windows login for this project is different than my ADO account so when I build the solution in VisualStudio I get asked for credentials for the NuGet store. I enter my credentials and it immediately asks me again for creds. It does this 4 or 5 times then finally fails.
Minutes to hours later, I can no longer pull/push code from the Git repos. I've tried switching to a PAT but same result. I can get into ADO through a browser and see the repositories. I'm an org admin but can't see users and permissions during this time. If I wait a few hours, it will start working again. I verified my user is NOT locked in AzureAD. I get denied on all devices (on and off client network).
I think I've fixed the issue of the NuGet authentication but does anyone know if there's a "lock out" feature in ADO that I'm missing? If so, is there a way to "unlock" the user when this happens.
The error I get back in Git seems to be a standard failed authentication:
fatal: Authentication failed for 'https://****.visualstudio.com/DefaultCollection/projectname/_git/repo-name/'

Related

Azure pipeline to build xcode project can't clone repo

I would like to know if you have any ideas of what happens to the following pipeline I'm developing to build an xcode project.
I'm configuring a pipeline with the xcode build, copy files, and publish artifact tasks.
I have configured the build task, with my xcworkspace path, and set up the scheme
I have all of my repos, in bitbucket, but I have set it up a service connection between my Azure devops, and bitbucket, using an app password, which have all the permissions allowed, I have developed a pipeline to build an Android app, and I don't have problems with that one, just to mention that this one doesn't depends on other separated repos
The thing is that, the developer separated the api client in a repo, from the main repo were the iOS code is, so when Azure tries to clone this repo, it can't be done, due to a host key verification, he told me that this repo is dependency of the main iOS repo.
This is the error
I'm new to Azure devops, but I have searched for solutions, and nothing. I understand that I have to configure an SSH key, but, I'm using a pipeline with a hosted microsoft agent. Should I add a task to actually set up this SSH key to the agent? Or it is only permission problems?
The things I have done, are:
Creating the app password again, with all permissions set
Change my project path, and use the correct scheme, cause I was using the wrong one. But there's no difference
The only thing I have left is to add the user from my Azure devops to a group of admins, who actually have permissions to the repo Azure is trying to clone. But I need to open a ticket with my partner, cause I cannot logged into the mail account.

How do I fix problem synching with github on second PC?

I use private repositories on github and can access these quite successfully from my development PC and from some Azure VMs. I do not do anything at commend line. I do everything via TortoiseGit. These are all running windows 10.
On my second PC I used to be able to pull and push, but now it keeps asking ffor github login details, but it rejects these as invalid. I can log into github itself from the PC with the same user name and password. Any idea how I can synch with githib again on this PC ?
GitHub recently disabled password login for Git actions. YOu need to use a special app token.

Why is the Build trigger complaining about Webhooks missing

It is time we enabled the Continuous Integration of the build pipeline, so when I went to do just that, i am seeing something strange...
The trigger appears to be enabled? yet theres a message suggesting webhooks are missing to the repo and need to be restored. When i click restore, it fails!
The remote repository’s webhooks are missing or incorrect.
An error occurred while restoring the trigger’s webhook: Could not recreate the subscription. An error was encountered while creating the existing subscription: Unable to configure a service on the selected Bitbucket repository. Bitbucket returned the error 'Your credentials lack one or more required privilege scopes.'.
I asked the admin of the repo to try restoring it because i thought maybe this is a permissions issue, and even he got the error...
This is what the repository settings page shows for both myself and the repo developer/admin...
Do we have to add a webhook manually on bitbucket?
After debugging the issue further with the developer, it appears the app password we created in bitbucket may not have had the "Webhooks" option enabled.
Unfortunately, we cannot edit app passwords in Bitbucket, which is a bad constraint but whatever.
We ended up just creating a new app password, and enabled Webhooks permissions this time, then i updated the service connection with this new app password, and wala, it worked!

Accessing Azure Devops on premises via Visual Studio

I had installed Azure Devops on our Windows 2019 server. The server has 5 users and all of them were created as local users on the server. I added these 5 users in Dev Ops project. Four of these users started using visual studio directly on the same server and have cloned project from on premises Azure dev ops. When they connected to the Azure dev ops server, they simply used User1, User2.... username and their windows password to connect to the Azure.
After a couple of weeks, we implemented Active Directory and added this server into the active directory group. The existing four users are still able to pull, push the same project. However, when the fifth user which never logged in now needs to connect to the Azure Dev Ops to clone the project. When he tries to connect via Visual Studio, the visual studio adds Domain into the user name e.g. DomainName\User5 and azure dev ops connectivity is not accepting his windows password. This user is not a domain user and is local to the server. This user can login to Azure Dev Ops when accessing it from browser, but unable to connect when trying it from Visual Studio.
Also, when I logged in directly to Azure Dev Ops (on premises) and try to add members to project, it does not show domain users. It only shows local server users.
Do I need to reinstall Azure dev ops, what should be the apprpriate way to fix this issue?
Thanks
When the fifth tried to use Visual Studio to connect the project, and access the project on web browser, did he do these things also directly on the same server machine?
Due the fifth user can access the project on web browser, the account of this user should not have issue. The problem seems occurs on Visual Studio when trying the authentication for the account.
Please try to check with the following things to see if the problem can be solved:
Check if the user has login to Visual Studio with his account.
Check if Visual Studio has saved or cached the account information of other users. If yes, clean the cache. Then login to Visual Studio with the fifth user's account.
When trying to connect to the project on Visual Studio, make sure the the selected user id the fifth user.
If the issue still exists, please share us with the details error message that the fifth user gets.

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)