1
votes

I have multiple instances of a WebSite, all running the same WebJob, connected to the same AzureWebJobsStorage and configured to trigger on incoming blobs.

Unfortunetely, the result is different from what I intended - when a blob is saved to the storage, only one of the WebJobs instances picks it up. I would rather have all of them process this blob. My guess is that it works like this beacuse of how the blob receipt name is constructed - it contains the WebJob funcion name which is the same for all my WebJobs.

Is there any way to have the blob processed by all WebJob instances in this situation?

1
Can you add your method declaration with BlobTriggerAttribute ?Guillaume

1 Answers

2
votes

I just found an answer to this question by myself. It turns out that one can configure the HostId which gets included in the blob's receipt name. For me, the following piece of code does the job:

var applicationName = Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME");

var host = new JobHost(new JobHostConfiguration
                                       {
                                           HostId = applicationName ?? "localhost"
                                       });