Book Image

A Developer's Guide to Building Resilient Cloud Applications with Azure

By : Hamida Rebai Trabelsi
Book Image

A Developer's Guide to Building Resilient Cloud Applications with Azure

By: Hamida Rebai Trabelsi

Overview of this book

To deliver software at a faster rate and reduced costs, companies with stable legacy systems and growing data volumes are trying to modernize their applications and accelerate innovation, but this is no easy matter. A Developer’s Guide to Building Resilient Cloud Applications with Azure helps you overcome these application modernization challenges to build secure and reliable cloud-based applications on Azure and connect them to databases with the help of easy-to-follow examples. The book begins with a basic definition of serverless and event-driven architecture and Database-as-a-Service, before moving on to an exploration of the different services in Azure, namely Azure API Management using the gateway pattern, event-driven architecture, Event Grid, Azure Event Hubs, Azure message queues, FaaS using Azure Functions, and the database-oriented cloud. Throughout the chapters, you’ll learn about creating, importing, and managing APIs and Service Fabric in Azure, and discover how to ensure continuous integration and deployment in Azure to fully automate the software delivery process, that is, the build and release process. By the end of this book, you’ll be able to build and deploy cloud-oriented applications using APIs, serverless, Service Fabric, Azure Functions, and Event Grid technologies.
Table of Contents (18 chapters)
1
Part 1: Building Cloud-Oriented Apps Using Patterns and Technologies
5
Part 2: Connecting Your Application with Azure Databases
13
Part 3: Ensuring Continuous Integration and Continuous Container Deployment on Azure

Exercise 3 – connecting Azure App Service with Azure Cosmos DB

In this section, we will connect Azure App Service with Azure Cosmos DB as a database. An ASP.NET Web API will connect to a Cosmos DB database to manage the appointments booked by patients before sending them to the doctor’s dashboard.

We will use Visual Studio 2022 with the Azure workload installed. We will follow these steps to connect to Azure Cosmos DB using Connected Services:

  1. In Solution Explorer, right-click the Connected Services node, and, from the context menu, select Add Connected Service:
Figure 9.20 – Connected Services

Figure 9.20 – Connected Services

  1. In Connected Services, select Add a service dependency or the + icon for Service Dependencies.
  2. On the Add dependency page, select Azure Cosmos DB:
Figure 9.21 – Add dependency – Azure Cosmos DB

Figure 9.21 – Add dependency – Azure Cosmos DB

  1. Select Next. On the Connect to Azure Cosmos DB page, select an existing...