Cosmos DB Server-Side Primer – Episode 1

Stored procedures in Cosmos DB are JavaScript functions that run close to the data to ensure high performance. In addition to great performance, stored procedures provide multi-operation transaction support with automatic rollback when things don’t go as planned. In this episode, we’ll look at the server-side Collection and Response classes to learn how to create and update… Continue reading Cosmos DB Server-Side Primer – Episode 1

Shape CosmosDB Output with JMESPath

According to James Saryerwinie, his truly awesome query language for JSON is pronounced James Path. I trust him on the pronunciation of JMESPath. Besides, when I used to say “Jay-mezz Path,” it just sounded wrong to me. I fell in love with JMESPath using the Azure CLI. Many of the Azure CLI commands support a… Continue reading Shape CosmosDB Output with JMESPath

Generating Cosmos DB Auth Tokens in Postman

If you read the official article that describes how access control works in Cosmos DB, you’ll see this handy Node.js function for generating authentication tokens using a master key: var crypto = require(“crypto”); function getAuthorizationTokenUsingMasterKey(verb, resourceType, resourceId, date, masterKey) { var key = new Buffer(masterKey, “base64”); var text = (verb || “”).toLowerCase() + “\n” + (resourceType… Continue reading Generating Cosmos DB Auth Tokens in Postman