Question:
In your e-commerce system, you've built two Azure Functions to handle order processing and retrieval. The OrderProcessingFunction is triggered when an order is placed by a customer via an Azure Service Bus queue. The details of this order are then processed and stored into a cloud storage system for later reference. Configuration for the service is stored into Cosmos DB database. The OrderRetrievalFunction is invoked on-demand via a web request, which fetches and returns the previously stored order details.
Which triggers and bindings would you use in the OrderProcessingFunction?
Answer:
The OrderProcessingFunction uses the ServiceBus trigger binding because it is triggered by new messages (orders) arriving in the Azure Service Bus. Configuration for the service is stored in a Cosmos DB database, so a Cosmos DB input binding is required. Function uses the Blob output binding to store the processed order details into Azure Blob Storage, a cloud storage system.