Pipelines
11 TopicsTrigger Azure pipeline from multiple repositories
Hello. I am trying to create a simple pipeline that runs tests. I wanna trigger my pipeline from 2 repositories (I used this doc https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#triggers). The first repository contains ‘azure-pipelines.yml’, in which I specified triggers from both repos: resources: repositories: - repository: todo-app-server type: github endpoint: max_pat name: maximkulakivsky/todo-app-server trigger: - master trigger: - master ... When I make a commit to the first repository everything is working and the pipeline is triggered. But when I make a commit to the second repo nothing is happening. I tried changing my Oauth connection to Github PAT (I used this doc https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml), but that didn’t help. Please, help me.9.3KViews0likes2CommentsBUILD PIPELINE NuGet ERRORs
I am writing my first BUILD Pipeline and am having problems. First my environment: 1) On Prem TFS/DEVOPS 2) behind firewall 3) On Prem NuGet Server 4) source is stored in TFVC 5) code is for a CRM plugin 6) solution consists of around a dozen projects I am trying to create a BUILD pipeline that compiles the checked in code. i have created a Pipeline that is based on a .NET Desktop template the first task in the agent is to Use NuGet 4.4.1/ I have selected the Default Agent Pool this step fails with the following errror; You are using a query match on the version string. Behavior changes or breaking changes might occur as NuGet updates to a new version. ERR:connect ETIMEDOUT 152.199.23.209:443 ##[section]Finishing: Use NuGet 4.2.0.2457 i checked: the IP address is blocked by our firewall if i disable this step, the Pipeline fails on the next step which is the NuGet restore step. the NuGetError.doc attachment shows the errror. It looks to me like it was not able to download the required local Nuget packages. I don't know how to resolve this problem. Can someone suggest a solution? thanks4.2KViews0likes2CommentsSudden errors with pipelines and artefacts: Can't download artifacts from other pipelines
Hi, since today I'm experiencing issues with the DownloadArtifactPipeline suddenly. What we do is basically downloading an artifact from a different pipeline. ##[error]No builds currently exist in the pipeline definition supplied. This is strange because it worked flawlessly before, has something changed with this task? Or have someone experienced the same issue before - task: DownloadPipelineArtifact@2 displayName: 'Download Pipeline Artifact' inputs: source: 'specific' project: 'xxxx' pipeline: '2303' buildVersionToDownload: 'latestFromBranch' branchName: 'refs/heads/main' path: '$(Pipeline.Workspace)/stages'3.4KViews1like0CommentsGrant "Pipeline Resources Use and Manage" for System.AccessToken
I have an Azure DevOps pipeline where I am generating an https://learn.microsoft.com/en-us/azure/devops/pipelines/process/environments?view=azure-devops, then I trigger new pipelines that target these environment. Before I do this, however, I am allowing pipelines to be used in this environment with the following script: $EnvironmentId = (terraform output -raw devops_environment_id) $base64EncodedPat = [Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("-:$(System.AccessToken)")) $apiHeaders = @{ Authorization = "Basic $base64EncodedPat"} Write-Host "Getting environments for ID $EnvironmentId" # Get all agent pools, and filter by naming convention on name of "environment-$EnvironmentId" $deploymentTargetsRaw = (Invoke-WebRequest ` -Headers $apiHeaders ` -Uri "https://dev.azure.com/MyOrganisation/_apis/distributedtask/pools?poolType=deployment&api-version=7.1-preview.1").Content $deploymentTargets = $deploymentTargetsRaw | ConvertFrom-Json -Depth 100 $resources = @( @{ resource = @{ type = "environment" id = $EnvironmentId } allPipelines = @{ authorized = $true } } ) $deploymentTargets.value ` | Where-Object { $_.name.StartsWith("environment-$EnvironmentId") } ` | ForEach-Object { Write-Host "Matched agent ID $($_.id) because it has name $($_.name)" $resources += @{ resource = @{ type = "agentpool" id = $_.id } allPipelines = @{ authorized = $true } } } #Now disable pipeline granting permissions on all agentpools and the environment $result = Invoke-WebRequest ` -Headers $apiHeaders ` -Uri "https://dev.azure.com/MyOrganisation/MyProject/_apis/pipelines/pipelinepermissions?api-version=7.1-preview.1" ` -Body (ConvertTo-Json $resources) ` -Method Patch ` -ContentType "application/json" Write-Host "Status = $($result.StatusCode) granting resources for $($resources.Length) resources in environment $EnvironmentId" Write-Host "response from API call`r`n$($result.Content)" This has, however, stopped working because Azure DevOps have released a new PAT scope https://learn.microsoft.com/en-gb/azure/devops/release-notes/2023/sprint-215-update#new-pat-scope-for-managing-pipeline-authorization-and-approvals-and-checks, which the $(System.AccessToken) does not have. Does anyone know if it is possible to grant this scope to the $(System.AccessToken)?2.5KViews2likes2CommentsGitHub App authentication for Azure Pipelines causes webhooks to dissapear
Greetings, we are using GitHub as the code repository service together with Azure DevOps Pipelines for CI/CD. All the pipelines need to have their triggers authenticated to GitHub in order for the pipelines to trigger Authentication works either with personal OAuth Service Connections or via the Azure Pipelines App for GitHub The recommended way is using the Pipelines App The problem: when I authenticate the pipeline trigger via the GitHub Azure Pipelines App, the webhooks from the repository which the pipeline is pointing to dissapear and the automatic triggering stops working! To make the issue even more ridiculous - we have 5 pipelines but only with 4 of them this happens! One is working completely fine with with the recommended GitHub App authentication. What I tried: Recreating service connections in Azure DevOps Reinstalling the Azure Pipelines GitHub App Recreating the pipelines Nothing worked, I am forced to use OAuth which is always throwing a warning to switch to app authentication because it's better performing and more reliable. Quite ridiculous to recommend a certain way of doing things, then making it work less reliable than the not-recommended way. Anyone has any ideas? Thanks in advance.2KViews1like1CommentAzure DevOps git tag release pipeline
I'm wanting to get an Azure DevOps Pipeline (Classic) to run on a schedule against a Git Tag. This tag is set by a CD pipeline to mark when it has been deployed in the live environment. The scenario is that a "safe" release can be re-released on a regular schedule to ensure that it still matches what is expected (it's an Azure ARM release, and I want to tidy up any unauthorised changes made by lazy engineers). I cannot though find a way to achieve this. While you can filter on tags from builds in a release pipeline, that's not Git tags, but things manually set in ADO. I have tried using a build pipeline first (don't actually need one for this, but I can live with it) and using a branch filter to refs/tags/mytag, but it never seems to run. Can anybody help out here?1.4KViews0likes2CommentsMirrors boards from one project to another
Hello, We have 2 projects under same org in our ADO instance. Project A holds pipelines and repos whereas the other Project B has the boards and work items. We would like to mirror the project B boards in project A which has pipelines and repos. Kindly suggest here. Thank you, Abhinav.927Views0likes0CommentsSetting up Code Coverage data in Azure DevOps Pipeline, C# .NET 9
Hello everyone, I would like some assistance with my Azure DevOps pipeline. I am trying to set up Tasks in my Azure DevOps pipeline to collect Code Coverage results, after running UTs using the VsTest Task, to then have a Powershell Task in the Pipeline write to a SQL db the contents of those metrics. The main issue I am encountering is actually finding the published results after the UTs successfully run. I have set up Tasks to publish the results, then find them & then insert, but the publish doesn't seem to actually publish to the directory I specify, or if it does publish, I cannot see where to. Here are the Tasks I currently have set-up. Task to run UTs: steps: - task: VSTest@2 displayName: 'VsTest - testAssemblies' inputs: testAssemblyVer2: | **\$(BuildConfiguration)\*\*test*.dll !**\obj\** runSettingsFile: '$/B3API/Main/B3API.Tests/codecoverage.runsettings' runInParallel: true runTestsInIsolation: false codeCoverageEnabled: true platform: '$(BuildPlatform)' configuration: '$(BuildConfiguration)' failOnMinTestsNotRun: true codecoverage.runsettings file: <?xml version="1.0" encoding="utf-8"?> <RunSettings> <DataCollectionRunSettings> <DataCollectors> <DataCollector friendlyName="Code Coverage"> <Configuration> <Format>cobertura</Format> </Configuration> </DataCollector> </DataCollectors> </DataCollectionRunSettings> </RunSettings> Task to publish results: steps: - task: PublishCodeCoverageResults@2 displayName: 'Publish code coverage results' inputs: summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.cobertura.xml' pathToSources: '$(System.DefaultWorkingDirectory)/**/coverage' Task to find published file & store into variable: steps: - powershell: | $coverageFile = "$(System.DefaultWorkingDirectory)/**/coverage.cobertura.xml" [xml]$coverageData = Get-Content $coverageFile $coveragePercentage = $coverageData.coverage.@line-rate # Store the coverage data in a variable Write-Host "##vso[task.setvariable variable=coveragePercentage]$coveragePercentage" displayName: 'Store Coverage in variable' The main issue it the Task to publish, it does not publish the results, I think it is due to not finding them in the first place. Thank you for taking the time to read my post, any help would be greatly appreciated, thanks!170Views0likes3Comments