-1

I have a Laravel project in Azure App Service .. I'm using Laravel queue to run long jobs in the background, so I've added a WebJob to run the queue .. the problem is the jobs execute sequentially and not parallelly.

After searching I found that I need a supervisor to run multiple workers.

My question is how can I run multiple workers to run the same queue in Azure??

My continuous WebJob:

php %HOME%\site\wwwroot\artisan queue:listen --timeout=0
Lama Youz
  • 23
  • 3

1 Answers1

0

Based on my understand of the issue. Continuous Job runs on all instances that the web app runs on. Indeed, you can optionally restrict the WebJob to a single instance (different in your case).

Note that App Service will only look for a script under the root directory of that job (not under sub directories of it). Only these are supported file types for scripts or programs are listed here:

Laravel, uses the public/ subdirectory as the site root.

Jobs are deployed by copying them to d:\home\site\wwwroot as illustrated below. These Jobs will run under the worker process of the SCM\Kudu Web Site and not the main site.

Path : wwwroot\app_data\jobs\continuous{job name}).

To set a continuous job as singleton during deployment then you can simply create a file called settings.job with the content: { "is_singleton": true } and put it at the root of the (specific) WebJob directory. However, in your case { "is_singleton": false }

If your requirement fits you can use WebJobs API or Azure Functions

AjayKumar
  • 2,812
  • 1
  • 9
  • 28