How can an Azure pipeline get code from intranet TFS 2018 - azure-devops

I saw several pages on Internet but none that explains how to do this.
I have Azure Pipelines, a Windows self-hosted agent and an intranet TFS 2018 Server.
I tried to create a “New Azure Repos/Team Foundation Server” service connection with a full access PAT and got this message: “Failed to query service connection API: 'https: //tfs…/defaultcollection/project/_admin/_services/_apis/projects'. Error Message: 'A task was canceled.'” However, I am not even sure this is what I need.
I want a build pipeline to trigger when developers checks-in in VS2019 for a project in TFS. This pipeline would get the code on the agent, build and create an artifact on Azure Artifacts. A release pipeline would take that artifact and deploy on our intranet servers.
Is that possible?
If yes, could you help me find what must be done in Devops and on the TFS servers?
If not, could you please tell me the best way to do the above?
Many thanks

When you create a "New Azure Repos/Team Foundation Server" service connection, you can try to choose Save without verification.
If you want to check in in VS2019 to trigger a build pipeline, then you need to find the Triggers tab in the build pipeline interface, and then enable continuous integration, add Branch filters.
You can install extension TFS artifacts for Release Management in your organization. With this extension, you can deploy artifacts from external TFS. When you add an artifact, select External TFS build, and then add the required information, you can deploy the artifact to your Internal service
You can get the projectId by calling the REST API below:
REST API : https://learn.microsoft.com/en-us/rest/api/azure/devops/core/projects/list?view=vsts-rest-tfs-4.1
Extension TFS artifacts for Release Management: https://marketplace.visualstudio.com/items?itemName=ms-vscs-rm.vss-services-externaltfs

Related

Azure DevOps see included commits in build

we are using Azure Pipelines to build and deploy various projects. We are using Enterprise Github service connection as our git repository source which we are using as part of the build pipelines that are running on on-prem AzureDevops build agent. We are then using on-prem hosted DevOps agents to deploy the service on our on-prem servers.
If we trigger a build we then receive an email notification about all the new commits which are included in the build. Is the same information (what commits are part of the build) included somewhere in the Azure DevOps UI? I was not able to find it and it's really difficult to then determine what I'm actually deploying our various environments as I'm not always the one who triggers each build.
Thanks

Azure DevOps 2020 - how do I select which artifacts to download for a release pipline (18.170.30525.1 (Azure DevOps Server 2020))

I have a build pipeline with 2 publish artifacts.
In my release pipeline i want to download just the first artifact.
I know that it should be possible as I have read here
In Azure Pipelines, you can, however, select which artifacts you want to download to the agent for a specific job and stage of the deployment. Typically, you will do this to improve the efficiency of the deployment pipeline when the tasks in that job do not require all or any of the artifacts, or if you implement custom code in a task to download the artifacts you require.
but I cant find it...
This is how the release job details look like:
as you can see the artifact selection is missing.
here is how I configured the artifact in the release pipe:
apparently there is an issue with on premiss none NTLM agents.
https://developercommunity.visualstudio.com/content/problem/520932/azure-devops-server-2019-where-is-partially-downlo.html
Partial artifacts feature isn't enabled by default in Azure DevOps Server 2019. We have an issue with "Download Build artifacts" not working with NTLM based proxy hence we couldn't roll out this feature to OnPremise customers.

Deploy to Azure Extension - Only Allows Creation of Github Actions Workflow. Wont Allow GitHub + Azure Pipelines Flow Creation

I am following the steps outlined here. I am using the Deploy to Azure Extension
https://learn.microsoft.com/en-us/azure/devops/pipelines/targets/deploy-to-azure-vscode?view=azure-devops#github--azure-pipelines
I have done the following steps.
I have managed to create a simple react app and then got the GitHub + GitHub Actions portion to work no problem.
Now, I want to get GitHub Plus Azure Pipeline to work. So, I deleted the GitHub Actions/Workflow files, and starting over with the CICD setup.
Next, I have enabled Use Azure Pipelines for GitHub in the extension.
Then, as per the steps/pictures outlined in the above microsoft documentation link, I have begun the configure CICD option from the command palette.
Selected the Visual Studio Subscription
Selected the target web app
Now, at this point, as per the linked tutorial, it is supposed to ask me to choose a azure devops organization, so that the azure pipeline YAML file can kick in. This step never happens.
instead, VS Code will proceed to generate a GitHub Actions Workflow just as it did before.
What should I do to the GitHub to Azure Pipeline working from this extension?
Update 1
In case anyone is curious, I have raised a issue on the visual studio community forum. You can find that here
https://developercommunity.visualstudio.com/content/problem/1182952/github-azure-pipelines-falls-back-to-github-github.html
As of now, there is an ongoing discussion but no solution yet.
You can try reinstalling Deploy to Azure Extension and enable Use Azure Pipelines for GitHub, and then configure CI/CD option again. If the issue persists, you can report this issue here.
You can create a pipeline directly in your azure devops project. Check out below tutorial
Build, test, and deploy JavaScript and Node.js apps
You will also need to create an Azure Resource Manager service connection to deploy to your azure resource from azure devops pipeline.
Deploy an Azure Web App (Linux)

Publishing artifacts to an external server

We are using azure devops pipeline to build our application including a Azure build agent. At the end of this process, I would like to publish the artifacts to an on-premise server shared directory (which will connect to company mandated deployment process (repliweb)).
Is that possible?
Looking at the documentation it looks like I can use publish artifact or copy file step (or maybe even ftp).
Our IT organization needs to know the IP/port so that the firewall rules can be authored.
Where can I get that information?
I suppose the other possibility would be have our server pull the artifact from Azure devops.
Publishing artifacts to an external server
For this issue, you can try to use FTP Upload task in the pipeline. Using this task in a build or release pipeline to upload files to a remote machine using the File Transfer Protocol (FTP), or securely with FTPS.
For details,please refer to this document.

Azure Devops Pull Request and Jenkins behind corporate network

I'm trying to figure out how can I connect my Jenkins Build server to the Azure DevOps Pull Request. My Jenkins Server is behind a corporate firewall, I don't have any way to have access to this server outside of the corporate network.
Due to the corporate network rules I cannot add a hook in Azure to call my Jenkins server, but my server can have access to the Microsoft Azure web site.
I tried to run the VSTS Agent with success on my Linux Jenkins server. It works, but It doesn't do what I would need to do. I don't want to change all my build process to build my application inside this Agent. I really want to be able to launch a Jenkins Pipeline build from my server and forward the build result to the Azure DevOps.
I cannot use the Jenkins VM provided by Azure DevOps, because my Jenkins build process has to run some regression test tool on real hardware unit in our lab to flag the build as a success.
So in other word:
1- I cannot use the VSTS agent because I need to use my Jenkins Build Server
2- I cannot use the Jenkins VM provided by Azure DevOps because I need to have access to real Hardware Unite
3- I think I cannot instrument my Jenkins to see if we have a new Pull Request branch, because I will not be able to send the Jenkins build result to the Microsoft Azure DeveOps server.
Anybody had to do something like that?
Any reading to suggest?
Thanks!
Since one-way communication is going to be possible (from Jenkins to Azure DevOps), you'll have to do the following:
Set up your Jenkins pipeline to periodically poll Azure DevOps for new PR branches and build PRs
Set up a branch policy for approval from external services
Have Jenkins post the build status back to the external service API so that Azure DevOps knows whether the build has succeeded or failed