Resolved- No package found with the specified pattern: D:\a\r1\a***.zip

Today in this article, we see how to fix Azure devops build error “No package found with specified pattern”

Issue Description No package found with specified

Azure ADO build commands give the below error,

 No package found with specified pattern: D:\a\r1\a***.zip.
no package found with specified pattern dar1a zip

Resolution

The error I found to be due to missing artifacts after the build process.

Please copy and add artifacts from the build location.

The missing artifacts were visible in the pipeline as well as it shows no artifacts in the pipeline configuration.

Directory'/home/vsts/work/1/a' is empty

I was able to fix the issue by adding a predefined task for publishing – PublishBuildArtifacts@1 in YAML file

Below sample YAML with changes are highlighted.

trigger:
- master
pool:
  vmImage: ubuntu-latest
variables:
  buildConfiguration: 'Release'
steps:
- script: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'
- task: CopyFiles@2
  inputs:
    targetFolder: '$(Build.ArtifactStagingDirectory)'    
- task: PublishBuildArtifacts@1    
  displayName: 'Publish Artifact: drop'
  inputs:
    PathtoPublish: '$(build.artifactstagingdirectory)'

In the above command,

  • pathToPublish: This is the path of your artifact. and could be an absolute or a relative path.
  • artifactName: Name of your artifact.

After modification as above and triggering the build, I was able to publish the artifacts package.

Alternatively, you can also use Publish commands as below,

steps:
- publish: $(build.artifactstagingdirectory)
  artifact: WebApp

Azure no package found with specified pattern dar1a zip

References :

That’s all! Happy coding!

Does this help you fix your issue?

Do you have any better solutions or suggestions? Please sound off your comments below.



Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published(2024) best practices and guidelines for software design and development.



2 thoughts on “Resolved: No package found with specified pattern

  1. I also had this error, however it was a different issue for me. I had defined the artifact Source Type as an Azure Repository and not Build. Changing the artifact Source Type to build fixed it.

Leave a Reply

Your email address will not be published. Required fields are marked *