Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure DevOps pipeline cannot find pipeline YAML file

When using Azure DevOps, there are times when the pipeline YAML file is not discovered and I'm unable to manually run a build.

In our case we only run automatically on commits to the master and develop branchesm, so it's expected that we run other branches manually. At this time we only have the pipeline YAML file in our develop branch.

Following these steps, Azure DevOps cannot find the pipeline YAML file and will not allow you to trigger a manual run.

  1. Create a new called test-branch, branching from 'master'.
  2. Delete test-branch.
  3. Re-create test-branch, branching from develop.

I can now see that the pipeline YAML file exists for the branch in the repository. However, when I try to manually run that branch the 'Run' button is greyed out. When I try to edit the pipeline YAML file I'm presented with the following error -

File azure-pipelines.yml not found in repository GitHubOrg/Repository at version/branch test-branch.

To be clear, the pipelie YAML file exists and runs on other branches. But it's almost like Azure DevOps is not properly pulling branch when I select to run/edit it, and I can't see any way to force that action.

I don't want to have to delete the pipeline from Azure DevOps because I'd lose my existing build history and have to update the associated deployment, but as it stands I can't see any other way.

Has anyone else experienced this behaviour and come up with a fix?

like image 416
David Gard Avatar asked Apr 27 '20 15:04

David Gard


People also ask

How do I find Azure pipeline YAML?

To access the YAML pipeline editor, do the following steps. Sign in to your organization ( https://dev.azure.com/{yourorganization} ). Select your project, choose Pipelines, and then select the pipeline you want to edit. You can browse pipelines by Recent, All, and Runs.

How do I view the pipeline on Azure DevOps?

To view active release pipelines, select Pipelines > Releases. From there, you can drill into the details of a release. For example, here we show the Release-3 pipeline.


1 Answers

Short answer: I'm an Azure Devops noob and I didn't know what I was doing.

Detailed answer: In my case, I was getting the "File azure-pipelines.yml not found in repository GitHubOrg/Repository at version/branch test-branch." because the service connection to GitHub for the solution in repostiory x had been deleted, apparently due to someone cleaning up what they thought were unused service connections (because I had created a bunch of svc connections needlessly).

The solution for my scenario which is admittedly slightly different from the initial question above but which also results with the same '...cannot find yml file..." error:

  • Create a new (in my case GitHub) service connection. enter image description here

enter image description here

enter image description here

  • Go back to the build pipeline and click the Edit button. Note, if you still get the YML not found error click the "Use default editor" to the right of the banner.

  • Select "Triggers", then Click on YAML. Now find your service connection in the drop down list to the right of the text "Authorize using connection" under the right pane titled "Select a source" and then click "Save" under the menu item "Save and queue".

  • You should now be able to run or edit a build the pipeline successfully.

  • You're welcome!

enter image description here

like image 185
Vance McCorkle Avatar answered Sep 22 '22 18:09

Vance McCorkle