Belsnickel, Krampus, the Lutins, Rudolph, the Elves, Frau Perchta, Frosty, the Yule Goat, Ded Moroz, Mari Lwyd, and more – there are many creatures lurking about in this holiday season! In this blog post series, we’ll create a catalog of holiday creatures and deploy it to Azure using secured credentials throughout the dev and production processes.
Note: This series is a part of the Festive Tech Calendar, C# Advent Calendar, and .NET Advent Calendar. Be sure to check them out!
This is a passwordless approach to developing in Azure. While the code for this series is going to show the Azure Identity SDK and Azure Cosmos SDK in C#, you could also do this in other languages. Here is a table of versions of libraries that this could work with.
C# | Java | JavaScript | Python | |
Azure Cosmos DB SDK | .NET SDK v3 | Java SDK v4 | JavaScript SDK v3 | Python SDK v4.3.0b2 or higher |
Azure Identity SDK | Azure Identity client library for .NET | Azure Identity client library for Java | Azure Identity client library for JavaScript | Azure Identity client library for Python |
The code for this series is available in my holiday-creatures repo on GitHub.
For this series, we will cover each of these in separate blog posts:
- Work with Custom Roles for RBAC with Azure Cosmos DB for NoSQL
- Create a .NET Console app to load the data
- Create a Web application to read the data
- Get the passwordless Web application running in Azure
Prerequisites
If you are coding along with this post, there are some prerequisites you need to have:
- Azure Cosmos DB for NoSQL account
- Create an Azure Cosmos DB for NoSQL account.
- Note: The Free tier will work for this demo.
- Add the resource group name, account name, and URI to the table below
- Azure CLI
- .NET 6.0 SDK
Value Tracking
As you go through the blog series, you will need to have certain values. I’ve created this table to help track the values you will need throughout the series.
Field | Your Value | Where Used | Variable Name |
---|---|---|---|
1. Resource Group Name | Azure CLI commands | $resourceGroupName | |
2. Azure Cosmos DB for NoSQL account name | Azure CLI commands | $accountName | |
3. Azure Cosmos DB for NoSQL URI | Environment Variable: COSMOS_URI | ||
4. “name” from response in read-only role creation (GUID) | Used in role assignment | $readOnlyRoleDefinitionId | |
5. “name” from response in read-write role creation (GUID) | Used in role assignment | $readWriteRoleDefinitionId | |
6. Object ID for Azure CLI principal | Used in read-write role assignment | $principalId | |
7. Object ID for App Service Managed Identity | Used in read-only role assignment | $managedIdentityObjectId |
[…] parameters. This constructor is supported in newer versions of the Azure Cosmos DB SDK – see the main post for those […]
[…] part of this series for the holidays, we are going to be working with Azure Cosmos DB for NoSQL and accessing the database without […]