7
votes

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?

2
How's the result if you test in a new session of the browser? How's the result if you delete azure-pipelines.yml in test-branch and re-create one? Are you able to capture a fiddler trace when you edit the YAML file?Cece Dong - MSFT
@CeceDong-MSFT - No change with a new session (laptop was off overnight). I've also tried going incognito, but no luck. In the end I updated the readme and committed that, and then Azure DevOps was able to find azure-pipelines.yml.David Gard
How often do you get this issue? Are you able to capture a fiddler trace for this issue?Cece Dong - MSFT
@CeceDong-MSFT - I can reliably replicate the issue by following the steps outlined in the question. I'm unable to provide a Fiddler trace because my company prevents me from disabling their chosen proxy, so I'm unable to route traffic via Fiddler.David Gard
Weird that I'm not able to reproduce your issue, which YAML template do you select? I've tested with Azure Repos Git. Are you able to reproduce this issue on other client machine?Cece Dong - MSFT

2 Answers

1
votes

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

0
votes

I had the same error and in my case someone rename .yaml scripts in repository but didnt choose new .yaml name in pipeline setting.