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:
- In Solution Explorer, right-click the Connected Services node, and, from the context menu, select Add Connected Service:
Figure 9.20 – Connected Services
- In Connected Services, select Add a service dependency or the + icon for Service Dependencies.
- On the Add dependency page, select Azure Cosmos DB:
Figure 9.21 – Add dependency – Azure Cosmos DB
- Select Next. On the Connect to Azure Cosmos DB page, select an existing...