Azure cosmos DB

SQL vs NoSQL — Simple Comparison

Azure Cosmos DB is Microsoft’s fully managed, NoSQL database service.

Advantages

  • Fully managed service (no server maintenance)
  • Automatic backups

When should you use Cosmos DB?

Choose Azure Cosmos DB when your application needs:

  • Global availability across multiple regions

Docker and Containerization with .NET

Docker is an open-source platform that lets you package an application and all its dependencies into a container, so it runs consistently across different environments.

Why Docker?

Docker is extremely useful for modern .NET applications, especially when deploying APIs, microservices, Azure/AWS applications, Kubernetes, etc.

Without Docker:

  • Your app works on your machine but fails on someone else’s.
  • Different operating systems or library versions cause compatibility issues.
  • Setting up development environments is time-consuming.

With Docker:

  • Your application runs the same everywhere.
  • Easy deployment and scaling.

What is Containerization?

Containerization means packaging an application along with everything it needs to run:

  • Application code
  • .NET runtime
  • Dependencies
  • Libraries
  • Configuration

So the application behaves consistently on:

💻 Developer machine → 🧪 QA → 🚀 Production → ☁️ Azure/AWS

What is Docker?

Docker is a platform used to:

  • Build containers
  • Package applications
  • Run containers
  • Deploy applications consistently

Azure Key Vault

Azure Key Vault is a cloud service from Microsoft Azure that securely stores and manages sensitive information such as secrets, cryptographic keys.

What can Azure Key Vault store?

It supports three main types of data:

  1. Secrets
    • Passwords
    • API keys
    • Database connection strings
    • OAuth tokens
  2. Keys
    • RSA and ECC encryption keys
    • Keys used for encryption, decryption, signing, and verification
    • Can be software-protected or backed by a Hardware Security Module (HSM)
  3. Certificates
    • SSL/TLS certificates
    • Certificate lifecycle management (creation, renewal, import)

For Local test Install the Azure CLI on Windows
for Azure AD user authentication

Powershell run as admin

Let us see how it works for our App Service with above settings

1. Enable Managed Identity

If your .NET API is deployed to Azure App Service:

Azure Portal → App Service → Identity → System assigned → On → Save

Create App Service in san-keyvault resource group

Make sure we are adding role assignment at key vault level and assign it to all app services which you want to execute this key vault policy





Let us see how to load all azure key vault to IConfiguration and use dynamically using IConfiguration

.NET Framework, .NET Core, and modern .NET

Typical version

.NET Framework 4.8

.NET Core

Microsoft introduced .NET Core to create a modern, lightweight, cross-platform .NET.

Latest Version


.NET Core 3.1

Instead of: .NET Core 4 Microsoft released: .NET 5 i.e. MODERN .NET

Then:

.NET 6
.NET 7
.NET 8
.NET 9
.NET 10
.NET 11

This is what we call modern .NET.

Modern .NET is Unified Platform

Runtime Difference

.NET Framework

Uses: CLR

Mainly tied to Windows.

.NET Core

Introduced:

CoreCLR

Designed to be:

  • Cross-platform
  • Lightweight
  • High-performance