Sample Azure Function

To explain the concepts of Azure Functions, we'll make use of a fictional company, ShipAnyWhere. ShipAnyWhere is a large logistical company that is specialized in commerce and fulfillment. ShipAnyWhere provides solutions for e-commerce businesses across the world. It has got more than 100 distribution centers across more than 30 countries. It provides B2B, e-commerce, and multi-channel fulfillment solutions to its customers using cutting-edge technologies.

ShipAnyWhere has a web application that allows orders to be submitted by customers. When an order is submitted, the following takes place:

  1. The web application puts the Order message in a Service Bus queue
  2. An Azure Function receives the Order messages from the Service Bus queue
  3. The availability of the products being ordered is checked with Inventory DB, which is a Cosmos DB database collection
  4. Based on the availability of the products, the status of the order is updated to either "accepted" or "rejected" in Sales DB, which is also a Cosmos DB collection:

There are two approaches we can take to create an Azure Function:

  • Using the Azure portal: The Azure portal provides a quick and easy way to create Azure Functions by making use of built-in templates.
Please refer to https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-azure-function to find out how to create your first Azure Function in the Azure portal.
  • Using Visual Studio or Visual Studio Code: In real-world development scenarios, it is best practice to use Visual Studio or Visual Studio Code to build Azure Functions rather than create them in the Azure portal directly. This approach helps in reusing the existing libraries and aligning with DevOps practices.

Since this book tries to faithfully recreate the real-world experience for you, we will create an Azure Function using Visual Studio Code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.173.227