0

Is there any guidance on when I should create a new Azure WebJob project in Visual Studio? I have many operations, most of them are queue triggered so using the SDK makes sense. But since queue triggered functions are static methods that are not referenced in Main I could just put everything in the same project. Is there any downsides to this? Will it for example limit the number of messages that the executable can process concurrently?

Joy Wang
  • 39,905
  • 3
  • 30
  • 54
Gabriel Smoljar
  • 1,226
  • 2
  • 14
  • 32
  • 1
    You can have a look at this post. It does not answer completely your question but can give you guidelines https://stackoverflow.com/questions/40273484/azure-web-job-performance-impact-of-multiple-functions-in-the-same-web-job-and – Thomas Mar 26 '18 at 23:23

1 Answers1

1

Is there any guidance on when I should create a new Azure WebJob project in Visual Studio?

With Web Jobs, your background processes can be executed as any command-line executable or script (.ps1, bash, executable, etc). You could execute some code in your project continuously or at a particular time(schedule). This can be very convenient. But we usually publish local webjobs to Azure. It all depends on your personal requirement. For more details, please read this article.

I could just put everything in the same project. Is there any downsides to this?

The static methods in Functions.cs would be triggered automatically. You needn't add references in Main class. And if you put all methods in project, I think it may affect the readability and performance. When you run the webjob project, it would load all static methods in Functions.cs. However, you could annotate useless methods when you just want to trigger specific static methods.

Will it for example limit the number of messages that the executable can process concurrently?

By default, the SDK gets a batch of 16 queue messages at a time and executes the function that processes them in parallel. For more details, you could learn Parallel execution in webjobs.

Parallel execution

If you have multiple functions listening on different queues, the SDK will call them in parallel when messages are received simultaneously.

The same is true when multiple messages are received for a single queue. By default, the SDK gets a batch of 16 queue messages at a time and executes the function that processes them in parallel.

Community
  • 1
  • 1
Janley Zhang
  • 1,567
  • 7
  • 11