Once the function is created, Visual Studio Code makes running it very convenient:
- Press the F5 key. The function host will be initiated and the Azure Function starts listening to the Orders queue for any new orders:
- The following is the sample file, which contains sku, quantity, and location. These will be used for updating the product inventory:
- Open the Service Bus Explorer and send the message to our Orders queue:
The Service Bus Explorer is a free tool that can be used for exploring Service Bus entities and sending messages to queues and topics. Please refer to the GitHub page of this tool: https://github.com/paolosalvatori/ServiceBusExplorer. You can also make use of Serverless360 for this purpose: https://www.serverless360.com/.
- At a breakpoint, you can see that any message received from the Orders queue will be printed in the terminal window: