Azure DevOps pipeline release Error: No package found with specified pattern: D:\a\r1\a\**\*.zip

Solution 1:

I had the same problem and after googling around I found this answer

In summary, that answer says that you you need to go to your builds section and edit it. Edit Builds

At the very end of the .yaml file you need to add an additional line.

- task: PublishBuildArtifacts@1

Add line to .yaml file

Queue a new build and you should be good to go!

Solution 2:

As every one has pointed this error is because the build task is not configured. You need to put the below YAML code at the last to make it work.

- task: PublishBuildArtifacts@1

You can see the error by going to this Azure tutorial , I have pointed to exact time line to avoid seeing the full video.

Happy learning coding.

Solution 3:

For us, it was just the wrong path on the Deploy task for the "Package or Folder". It wasn't matching what we had on the Pipeline tab (as one of the artifacts): enter image description here

Solution 4:

In my case I was deploying to the Azure App Service and I had to change the section packageForLinuxto use the path from PathToPublish by default it was System.DefaultWorkingDirectory

- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'drop'
    publishLocation: 'Container'

- task: AzureRmWebAppDeployment@4
  inputs:
    ConnectionType: 'AzureRM'
    azureSubscription: 'Pay-As-You-Go ($(subscriptionId))'
    appType: 'webApp'
    WebAppName: 'webappname'
    deployToSlotOrASE: true
    ResourceGroupName: 'resourceGroupName'
    SlotName: 'production'
    packageForLinux: '$(Build.ArtifactStagingDirectory)/*.zip'