Before we can create, read, update, and delete data using the APIs, we first need to create a Cosmos DB in Azure. We will do this in the following subsection.
Creating a Cosmos DB
You can create a Cosmos DB using the Azure portal, PowerShell, CLI, and ARM templates. In this demonstration, we are going to create a Cosmos DB server, database, and container from the Azure portal. Therefore, you have to take the following steps:
- Navigate to the Azure portal by opening https://portal.azure.com.
- Click Create a resource, type Azure Cosmos DB in the search bar and create a new database server.
- Add the following values:
- Subscription: Pick a subscription.
- Resource group: Create a new one and call it PacktCosmosResourceGroup.
- Account name: packtsqlapi.
- API: Core (SQL).
- Location: East US.
- Geo-Redundancy: Disable.
- Multi-region Writes: Disable.
- Availability Zones: Disable.
- Click Review + create and then Create.
- When the deployment...