6
votes

I have created a build pipeline which works correctly and publishes artifacts at the end.

I also created a release pipeline to deploy the REST API to Azure web app

The release pipeline task has this information:

$(System.DefaultWorkingDirectory)/**/*.zip

However I get this error:

Error: More than one package matched with specified pattern: D:\a\r1\a\**\*.zip. Please restrain the search pattern.

When I see the drop folder, I can indeed see that there are folders by date and there are several .zip files

enter image description here

The webapi is in the drop root, but also in the shown folder.

I havent been able to find how to clean the entire drop folder each time, or how to avoid this error.

Update 1:

In the build pipeline I can see when publishin this:

##[section]Starting: Publish Artifact: webapidrops
==============================================================================
Task         : Publish Build Artifacts
Description  : Publish build artifacts to Azure Pipelines/TFS or a file share
Version      : 1.142.2
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=708390)
==============================================================================
##[section]Async Command Start: Upload Artifact
Uploading 31 files
Uploading 'webapidrops/2019_04/04_06_58/LuloWebApi.zip' (16%)
Uploading 'webapidrops/LuloWebApi.zip' (16%)
Uploading 'webapidrops/LuloWebApi.zip' (33%)
Uploading 'webapidrops/LuloWebApi.zip' (50%)
Uploading 'webapidrops/LuloWebApi.zip' (66%)
Uploading 'webapidrops/LuloWebApi.zip' (83%)
Uploading 'webapidrops/LuloWebApi.zip' (100%)
File upload succeed.
Upload 'D:\a\1\a' to file container: '#/1483345/webapidrops'
Associated artifact 387 with build 125
##[section]Async Command End: Upload Artifact
##[section]Finishing: Publish Artifact: webapidrops
2

2 Answers

8
votes

The zip files are came from your build pipeline. if you need only the LuloWebApi.zip so configure your build pipeline publish artifacts task to take only this.

If you need also the second zip for your release so you can specify the LuloWebApi.zip in your release:

$(System.DefaultWorkingDirecotry)/**/LuloWebApi.zip

Or, you mentioned that the zip also exist in the date folder so specify this folder:

$(System.DefaultWorkingDirectory)/**/**/*.zip
0
votes

My issue was I had an MVC Project and an API Project in the same solution - Creating a POC. I deleted the MVC project (via Visual Studio). However, the physical files were still part of source control.

When deploying (via Azure DevOps) it still had both projects as part of the artifacts and threw that error.