Demonstrates Azure Queue Storage and Azure Function for understanding basic working of these two services. The solution contains two projects.
- This is a
WebApi
project. Thepost
method ofQueueStorage
controller can be used to enqueue message to the queue. The method shows different ways to enqueue. Insideprogram.cs
, you can configure connection to your azure account. By default, it is usingManaged Identity
, but following inline comments, you can easily substitute your<storage-acc-connection-string>
and<queue-name>
and make start enqueueing messages. - This WebApi project has a
BackgroundJob
namedWeatherDataService
which is listening to the queue and dequeues any message as soon as it arrives in the queue. By default, it is disabled, because I had to addAzure Function
to demonstrateQueueTrigger
. You can enable it on line 12 and 13 ofProgram.cs
.
This is Azure Function
app, that uses QueueTrigger
to dequeue the messages from the queue. You can substitute your <storage-acc-connection-string>
and <queue-name>
and run it.