Mukul
Mukul

Reputation: 371

Wildcards in VSTS Release Definition

I am trying to deploy Webjobs(4 of them) to App service, but while deploying them I am getting error -

2017-12-11T11:44:09 ==============================================================================
2017-12-11T11:44:10 Got connection details for Azure App 
Service:'**********'
2017-12-11T11:44:10 ##[error]Error: More than one package 
matched with specified pattern. Please restrain the search 
pattern.
2017-12-11T11:44:13 Successfully updated deployment History 
at ***********
2017-12-11T11:44:13 ##[section]Finishing: Deploy Azure Webjob

Below is the configuration screen :- Configuration

Any idea how can I deploy all webjobs from single task instead of making multiple tasks?

Upvotes: 2

Views: 651

Answers (2)

Wouter de Kort
Wouter de Kort

Reputation: 39898

The Azure App Deploy task does take wild cards but this doesn't mean it can deploy multiple packages. The wild cards are used to search for a Web Deploy Package in multiple folders.

The default value is $(System.DefaultWorkingDirectory)/**/*.zip. This means that the task will search for a .zip file somewhere beneath your System.DefaultWorkingDirectory.

If you look at the code for the App Deploy Task (Yes! It's open source on GitHub) you see the check for only one matching file:

 if(availableWebPackages.length > 1) {
      throw new Error(tl.loc('MorethanonepackagematchedwithspecifiedpatternPleaserestrainthesearchpattern'));
 }
 webDeployPkg = availableWebPackages[0];

To deploy multiple Web Deployment Packages, the easiest is to clone the task and make sure that each search pattern matches a single Web Deploy Package. You would then end up with four tasks.

Or you send a pull request on GitHub to extend the task to deploy multiple packages at once.

Upvotes: 1

Marina Liu
Marina Liu

Reputation: 38136

For Azure App Service Deploy task, it can only deploy one webjob.

Since you have four webjobs, you should make sure the wildcards for the package should only match a unique webjob.

  • If you want to deploy all the four webjobs, you can use four Azure App Service Deploy tasks (as Daniel mentioned), and make sure each task only match one webjob.
  • If you want to deploy only one webjob which is changed, you can detect the changed wenjob and deploy for it. Detail steps, you can refer this post.

Upvotes: 1

Related Questions