'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.
- Create a new called
test-branch, branching from 'master'. - Delete
test-branch. - Re-create
test-branch, branching fromdevelop.
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?
Solution 1:[1]
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:
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!
Solution 2:[2]
In my case, I needed to change YAML file path in pipeline settings in order to find the correct YAML file.
Solution 3:[3]
I had the same error and in my case someone rename .yaml scripts in repository but didnt choose new .yaml name in pipeline setting.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | wei |
| Solution 3 | user3162626 |





