CodexBloom - Programming Q&A Platform

Azure DevOps Pipeline scenarios to Publish Artifacts with 'Path not found' scenarios

πŸ‘€ Views: 63 πŸ’¬ Answers: 1 πŸ“… Created: 2025-07-02
azure-devops ci-cd pipeline YAML

I tried several approaches but none seem to work. Hey everyone, I'm running into an issue that's driving me crazy... I'm working with an scenario with my Azure DevOps pipeline where it fails to publish artifacts... The behavior message indicates 'Path not found' for the specified artifact location, even though the path should be correct. Here’s the relevant part of my YAML pipeline configuration: ```yaml jobs: - job: Build pool: vmImage: 'ubuntu-latest' steps: - script: | echo Building the project... dotnet build MyProject.sln displayName: 'Build project' - publish: $(Build.ArtifactStagingDirectory)/output artifact: drop displayName: 'Publish Artifact' ``` I have verified that the build step produces output in the `$(Build.ArtifactStagingDirectory)/output` directory. I can see the output files in the logs, but when it reaches the publish step, I get this behavior: ``` ##[behavior]Path not found: /home/vsts/work/1/a/output ``` I’ve checked the path and it seems to be correct. Additionally, I’ve validated that `$(Build.ArtifactStagingDirectory)` is a valid directory and has the expected artifacts. I also tried changing the path to a static location, but the scenario continues. Has anyone encountered a similar scenario with Azure DevOps pipelines? What could be going wrong here? Any suggestions on how to troubleshoot this further would be greatly appreciated. I'm working on a CLI tool that needs to handle this. I'm working on a CLI tool that needs to handle this. Has anyone else encountered this? I'm coming from a different tech stack and learning Yaml. I appreciate any insights! I'm working with Yaml in a Docker container on CentOS. Thanks in advance!