ElCamino.AspNetCore.Identity.CosmosDB docs Icon identitycosmosdb

Azure CosmosDB Provider for ASP.NET Identity Core framework.

Package Versioning

Build Status NuGet Version

Quick Start Using Templates

dotnet new --install ElCamino.AspNetCore.Identity.CosmosDB.Templates

#MVC Template
dotnet new mvc-id-azure-cosmosdb

#Razor Pages Template
dotnet new rzp-id-azure-cosmosdb

MVC Template GitHub

Razor Pages Template Github

Development Environment

You will need to setup your development environment to use this solution. This guide assumes you are familiar with using Visual Studio 202x or later. Development requirements:

💡
Tip: When running the starter template applications, be sure to start the local CosmosDB emulator or adjust the configuration settings for your Azure CosmosDB instance.
Important:

Breaking changes to v3.0

Naming changes from DocumentDB to CosmosDB

  • Namespace change from ElCamino.AspNetCore.Identity.DocumentDB to ElCamino.AspNetCore.Identity.CosmosDB
  • Any class, method or configuration key has been changed from DocumentDB to CosmosDB

Data Migration

For existing data using ElCamino.AspNetCore.Identity.DocumentDB < v3.0, you should create a new container for the v3.0 configuration and then copy documents to the new container adding “/partitionKey” for the partition key. The partition key should be the last 4 characters of the id field.

Existing document:

{
    "id": "abc5cf45-1781-4f56-a9f0-abc64ffbef0f",
    "_rid": "MBxvAOomeosCAAAAAAAAAA==",
    "_self": "dbs/MBxvAA==/colls/MBxvAOomeos=/docs/MBxvAOomeosCAAAAAAAAAA==/",
    "_etag": "\"00000000-0000-0000-919d-8fe1789d01d5\"",
    "userName": "263225f79db04d99be098bed7bee3e03",
    "normalizedUserName": "263225F79DB04D99BE098BED7BEE3E03"
}

New document with Partition Key:

{
    "id": "abc5cf45-1781-4f56-a9f0-abc64ffbef0f",
    "_rid": "MBxvAOomeosCAAAAAAAAAA==",
    "_self": "dbs/MBxvAA==/colls/MBxvAOomeos=/docs/MBxvAOomeosCAAAAAAAAAA==/",
    "_etag": "\"00000000-0000-0000-919d-8fe1789d01d5\"",
    "userName": "263225f79db04d99be098bed7bee3e03",
    "normalizedUserName": "263225F79DB04D99BE098BED7BEE3E03",
    "partitionKey": "ef0f",
}