Azure pipeline error "Git fetch failed with exit code: 128" - azure-devops

I am trying to create a build pipeline in azure devops using this blog:
https://www.linkedin.com/pulse/ci-cd-azure-databricks-using-devops-deepak-rajak.
I have created a service connection with the my repository. I am getting this error and I can't resolve it. I think it is picking the wrong URL.
Error:

As you noted, this error means that the Git repository URL is wrong.
I have created a service connection with the my repository.
You need to correct the repo URL from the service connection. Not sure which Git repository you are using.
However, please note that URL should not be the project URL (e.g https://github.com/xxx/test).
It should be something like this: https://github.com/xxx/test.git

Please control your permission settings in Version Control.
in Azure , project settings >> version control.
select repositories and look security for all git repositories.
"Project collection administrator"

Related

Import azure devops code from one repository to another repository in same project

I am importing the code from one azure Devops repository to another repository in same project. while doing source code import to new repository. Import file option is not there.
workaround I did is below-
I cleaned the new Repository and then from old source code repository cloned the URL. used this URL to import in new repository -> File option -> import. Import option didn't appear. doc link here - https://learn.microsoft.com/en-us/azure/devops/repos/git/import-git-repository?view=azure-devops#import-into-an-existing-empty-repo
used the power shell script from this Microsoft documentation- https://learn.microsoft.com/en-us/azure/devops/repos/git/import-git-repository?view=azure-devops#manually-import-a-repo-using-az-repos-cli . using this script getting error "The User aaaaaaaaaaa-aaaaa-aaaa-aaaaaaaaa is not authorized to access this resource".
Can you please guide me to steps to move code from one repo to another in azure Devops?
Thank you!
You could clone the current repo to a new one both using "git commands" and from Azure DevOps UI. Please make sure the structure of both repos are the same and you have the corresponding permission to act with code in Azure DevOps.
1.From DevOps UI (Git as an example)
Paste the original repo's URL from browser:
https://dev.azure.com/{OrgName}/{ProjName}/_git/{OriginalRepoName}
Using DevOps PAT for authentication.
2.For Git commands, you could refer to this link for details: work on a repository from a different organization devOps
I'm not understanding why you need a special "import option" for this. Maybe you mean something by "import" that I'm not understanding? Why can't you just:
Check out both SourceRepo and DestRepo to your workstation.
Copy the source code from your SourceRepo working folder to your DestRepo working folder.
Commit and push DestRepo.

Create "Pull Request" in Sourcetree for Azure DevOps

I tried to create pull request in Sourcetree,
but it asked me to set Remote Project Configuration.
In the remote setting there is only 3 host types for this: Bitbucket, GitHub, Bitbucker Server.
there is no option for Azure DevOps
Is there is a solution for this?
I think you have an old version - that explains why the AzureDevOps option is missing.
UPDATE: Try adding a local repository instead remote

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)

VSTS\Azure-DevOps: Enabling Continuous Integration on pipeline with source from Bitbucket fails with error

Regards,
Your help will be appreciated.
I have created a pipeline in VSTS\Azure-DevOps. It gets its sources from a repository in Bitbucket. Queueing a build works fine. It builds and the tests succeed.
Now I want a build to run on every commit to the repository on Bitbucket. However, when I edit the pipeline and in the Triggers tab enable 'Continuous Integration' and click 'Save' I get the following error:
Unable to configure a service on the selected Bitbucket repository. Bitbucket returned the error 'Forbidden: '.
I am confused that I get 'Forbidden', while getting the source-code already works.
What is it that I am doing wrong? Is there something I must configure in VSTS\Azure-DevOps or in Bitbucket?
Answering my own question:
It appeared that in Bitbucket I only had the rights of 'Writer' for the Repository. When we changed it to 'Administrator' enabling Continuous Integration worked and we verified that committing a code change triggered the build.
Good news / bad news.
It looks like - for now - you can configure a pipeline without being a BitBucket admin on the repo... but not using the templates.
So you can build an empty pipeline based on a BitBucket repo (no admin access), and manually add each of the tasks.
Based on further tests: what you cannot do is set the Continuous Integration trigger, because that requires admin access to set up the webhooks
I know, this is not what you want... but at least there is a way to end up with a working pipeline.
Regards,
Jose

VS Team Services trigger option on build pipeline for external git repository

I have a unauthenticated (in vsts) external git repository that works in an local agent pool (who is auth) that is external too. Our build pipepline is the connection with our certificates that does this solution work.
The problem here is that there is no possibility to trigger automatically when someone push some changes on the master branch on this external unauthenticated (in vsts) git repository.
For this trigger option, there is only this configuration:
But after this, if someone push an commit, nothing happen.
Is there a limitation? Any configuration that I need to get this working? At now, it's always done manually to stat the build pipeline.
For the continuous integration with External Git, VSTS will connect to your external repository and check if there is new changes by the polling interval time you set. So you must configure the authentication in VSTS so that VSTS can access to your Git Repository to query new changes. When you configure the external git repository, it should ask you to provide user and password/token, enter the auth information there.