Publish a build artifect to a remote Git Repo - Azure DevOps - azure-devops

I have a build pipeline and I would like to publish the build artifect to a remote location which is a folder in an external Git repo. I have been able to create a "Azure Repos/Team Foundation" Server service connection to point to the external Azure DevOps. how do I consume that service connection through my build pipeline tasks? I could also use a release pipeline and copy the package over to a remote Git repo as well. How can I achieve this ?

I found the solution for this by using this extension - you can use it to point to a
TFVC repo
Git repo
Build pipeline
Release pipeline
TFS Artifects for Release Management

Related

How to copy files from one git repo to another git repo in Azure pipelines task?

There is one public source repo in github where all the source code is present. There is another github repo of mine which has some configuration files.
I want to run some tests of source repo using the configuration file present in my github repo using Azure pipeline task.
How can I checkout to source repo of github first and then do initial setup like build in that repo? And after that copy configuration files from my another github repo to the source repo directory and run tests of source repo.
I want to do these steps in Azure yaml pipelines as from azure release pipelines not all the artifacts are accessible.
Checking out multiple repos is possible, also with GitHub as a source, but don't forget to setup a GitHub service connection.
More info and options about this see: https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#specify-multiple-repositories
Since you want the GitHub repo to trigger the Azure DevOps pipeline, please check out the feature that is available since October 2022:
https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/github-actions?view=azure-devops

Azure DevOps : I want to add a task in my pipeline that can copy some files from my Azure Repo into an On premise VM. Any leads?

I have a requirement to create an Azure DevOps pipeline that can copy files from my Azure Repo to a path on an On-premise VM (a SQL server to be precise). Could anyone advise on how to get started on this?
You would need to add a checkout task to the pipeline. You would define the repo as a source and then add a step to checkout the repo. Here's some documentation concerning checking out multiple repos using yaml that should get you started

Not able to see Push to AzureDevOps service in sync option Visual Studio 2019

I am planning to use Azure Devops for code repository. I was able to add code to Git repository as you can see in below screenshot (I have a master branch). I am trying to push this to Azure Devops but while click on sync from Team Explorer, I am not able to see those three options:
Publish to GitHub
Push to Azure Devops service
Push to Remote Repository
Am I missing something? I really need to push this git repo to Azure Devops. I have already created a project in Azure Devops to push into that. Please help.

Tag external git repository after Azure DevOps release

I am quite new to Azure DevOps and here is my situation.
Build Pipeline (BitBucket connection)
dotnet build
dotnet pack
publish artifacts
Release Pipeline (Manually Triggered)
dotnet push
How to ?????
Question: How to tag the bitbucket repo after the release?
I have looked for answers and only tagging solutions i found were for TFS/VSTS repos but can't find much info on tagging bitbucket repo from release pipeline.
I do have a plan B if i don'd find a simpler/elegant way of doing this.
Plan B:
Build Pipeline (define git repo url and credentials in variables)
git checkout via powershell using repo url and credentials from variables
dotnet pack
publish artifacts
Release Pipeline
dotnet push
git tag & git push tag from powershell script using repo url and
credentials from variables

Is it possible to automate syncing of an external git repo to a AzureDevOps hosted internal git repo?

I would like to have a AzureDevOps internal git repository that is a forked version of an external open source library. Is it possible for AzureDevOps to have some way of automatically syncing with the external repo everyday?
I guess if it's not possible, I can have a script that automatically pulls from external and pushes to internal repo everyday.
If this is hosted on Github you can fork it and then trigger Azure DevOps pipeline on this fork change.