1

I have migrated my .NET Core 3.1 web api project to .NET 5, when I configured my release pipeline in azure DevOps, I have received the below error.

2021-02-18T16:07:51.6102920Z ##[section]Starting: Deploy Azure App Service 2021-02-18T16:07:51.6257075Z ============================================================================== 2021-02-18T16:07:51.6257406Z Task : Azure App Service deploy 2021-02-18T16:07:51.6257755Z Description : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby 2021-02-18T16:07:51.6260779Z Version
: 4.181.0 2021-02-18T16:07:51.6261044Z Author : Microsoft Corporation 2021-02-18T16:07:51.6261283Z Help : https://aka.ms/azureappservicetroubleshooting 2021-02-18T16:07:51.6261567Z ============================================================================== 2021-02-18T16:07:52.7413841Z ##[error]Error: More than one package matched with specified pattern: D:\a\r1\a***.zip. Please restrain the search pattern. 2021-02-18T16:07:52.7518620Z ##[section]Finishing: Deploy Azure App Service

These are the steps I did for .NET 5 deployment in Azure DevOps.

  1. Created Azure Web App with .NET 5 (Early Access) enter image description here
  2. Created Pipeline in Azure DevOps enter image description here
  3. Created Artifact from new release pipeline enter image description here
  4. Selected Azure App Service deployment template enter image description here
  5. Selected Dev stage enter image description here
  6. Run on agent settings enter image description here
  7. Azure App Service Deployment Settings enter image description here
  8. Created a new release enter image description here
  9. Received error enter image description here 10 ) Error in detail enter image description here

This is the problem that I'm facing right now. Anybody has an idea how to resolve ?

Parthiban
  • 81
  • 2
  • 12
  • Hi, Not get your latest information, are the answers below helpful for you? Or if you have any concern, feel free to share it here – Vito Liu Feb 24 '21 at 09:23
  • Hi @Parthiban, How about the issue? Does the answer below resolved your question? If not, would you please let me know the latest information about this issue? – Vito Liu Mar 02 '21 at 06:29
  • Yes' it's been resolved. – Parthiban Jun 15 '21 at 07:56

3 Answers3

0

The App Service Deploy task is only capable of deploying a single ZIP file at a time. It probably is detecting a duplicate (although it's possible it's something else). Your deployment path, $(System.DefaultWorkingDirectory)/**/*.zip, makes it convenient to pick up your build package and deploy it, but only if there's one.

You need to change that property to specify the single ZIP you want to deploy. It's ok to leave the ** in the path so long as the rest of the name resolves to a single file. You may want to go back to your last build run result, click on the Artifact that was published, and then inspect the contents to determine correct path and name.

WaitingForGuacamole
  • 3,744
  • 1
  • 8
  • 22
0

The task Azure App Service deploy field Package or folder means File path to the package or a folder containing app service contents generated by MSBuild or a compressed zip or war file.

enter image description here

The field default value is $(System.DefaultWorkingDirectory)/**/*.zip, it will match all zip file in the path $(System.DefaultWorkingDirectory) and If the number of zip files exceeds one, we will receive the error message: Error: More than one package matched with specified pattern: D:\a\r1\a\**\*.zip. Please restrain the search pattern.

We could specify the zip file for deployment, check the pic below:

enter image description here

Then it should work.

Vito Liu
  • 7,525
  • 1
  • 8
  • 17
  • Thanks for sharing, as per your instruction I have configured, now it has been working fine. – Parthiban Jun 15 '21 at 07:57
  • Out of interest how would I change this in YML? I have the task and I tried to add a website folder instead of **/*/.zip, but then got an error that said, Website does not exist. – Jason Nov 08 '21 at 10:32
0

If you visit the previous step of the release plan, you will be able to see zip files Azure found. It looks like there ismore than 1 .zip file. You just need to narrow your filter.