Reputation: 371
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 :-
Any idea how can I deploy all webjobs from single task instead of making multiple tasks?
Upvotes: 2
Views: 651
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
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.
Upvotes: 1