Adventures with Cosmos: Delete All Documents

When testing my Cosmos database I often like to reset the containers, or in other words, delete all the existing documents. Unfortunately, there is no way to do a DELETE * FROM in Cosmos, at least not yet. I know I could create a Console Application or Azure Function to do this, but I was…

Adventures with Bicep: Cosmos Connection Strings

I have been playing around with Azure Bicep for deploying my infrastructure to Azure. If you are new to Bicep, please take a look at Azure/bicep: Bicep is a declarative language for describing and deploying Azure resources (github.com). My challenge? I want to write Cosmos connection strings to Azure Key Vault. I am using Bicep…

Adventures with Azure: Azure SQL and Access Tokens

In this series of articles we will access an Azure SQL database using an access token provided by Azure AD. Why would we even want to do this? Doing it this way means we DO NOT have to provide a User Id and Password in our connection string. In Part 1 we will create the…

Adventures with Azure Cosmos DB: Limit Query RUs

If you have worked any with Azure Cosmos DB you are well aware of Request Units, or RUs. What exactly are RUs and how do they work? The cost of all database operations is normalized by Azure Cosmos DB and is expressed by Request Units (or RUs, for short). You can think of RUs per second as…

Adventures with Azure Cosmos DB: Repository Pattern

In a recent article, Adventures with Azure Table Storage: Repository Pattern, I wrote about how one possible implementation of the repository pattern using the Microsoft.Azure.Cosmos.Table SDK. This article mirrors that article, except this time around I used the Microsoft.Azure.Cosmos SDK. So if you are interested in getting a better understanding, please read that first article…

Adventures with Cosmos: Alerting and 429 Status Codes

During periods of peak transactions Cosmos may return a 429 Status Code – Too Many Requests, which means the collection has exceeded the provisioned throughput limit (RUs) and that you should retry the request after the server specified retry after duration. I want to setup alerting on both an Azure Function and the underlying Cosmos…

Adventures with Cosmos DB: High Ingestion Architecture

Let’s say you need you receive a large number of transactions from a third-party software system. The third party software system would like to send the requests via an API call. Each transaction needs to be validated (good data), enriched (add meta data) and transformed (convert to final format). My first attempt at solving this…

Adventures with Cosmos DB: Change Feed – Part 2

In Part 1 we looked at how to setup the Azure environment with a Cosmos DB and several Azure Functions, most of which, would be listening to the Cosmos DB change feed. In Part 2 we will take a deeper dive into each Azure Function and the nuances of working with the Cosmos DB change…