0
votes

Summary

I have an Azure Appservice; webapi, and when there are hundreds of requests received at the same moment the app service failed to pick them up quickly and the response time will be beyond 230 seconds, hence get server error. But this does not happen for like below 1xx requests.

Core functionality:

This app service logs the request to the blobstorage and sends the request body to a service bus.

My Question is:

I read web apps performance in Azure FAQ and it suggests to use webjob if the response was more than 230 seconds.

How could I send the appservice's request body to the webjob console application which expects string array as an input?

So that this webjob would do the blobstoring & sending to service bus(which was the appservice work.)

2
You can put a message in a storage queue (or a service bus queue) and web job can listen on that instead of expecting input.Madushan

2 Answers

1
votes

You can leverage Azure function for sending message to Azure Service bus.Azure Functions supports trigger and output bindings for Service Bus queues and topics. By running on Azure function that too on consumption tier also contribute to cost optimization.

Follow these which discuss about this :

https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus

https://blogs.msdn.microsoft.com/benjaminperkins/2018/11/02/azure-function-service-bus/

1
votes

What you actually need is a way to start a background process and then get the output once it's completed.

enter image description here

Here's what I would do:

Azure Functions + Durable Functions, triggered by a http request. In the response, you'll receive an URL to query for the status (Completed / Running).

More info: https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview?tabs=csharp

https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-create-first-csharp