AspNetCore.Identity.Stores.AzureStorageAccount 1.1.0

.NET 5.0
Install-Package AspNetCore.Identity.Stores.AzureStorageAccount -Version 1.1.0
dotnet add package AspNetCore.Identity.Stores.AzureStorageAccount --version 1.1.0
<PackageReference Include="AspNetCore.Identity.Stores.AzureStorageAccount" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AspNetCore.Identity.Stores.AzureStorageAccount --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AspNetCore.Identity.Stores.AzureStorageAccount, 1.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install AspNetCore.Identity.Stores.AzureStorageAccount as a Cake Addin
#addin nuget:?package=AspNetCore.Identity.Stores.AzureStorageAccount&version=1.1.0

// Install AspNetCore.Identity.Stores.AzureStorageAccount as a Cake Tool
#tool nuget:?package=AspNetCore.Identity.Stores.AzureStorageAccount&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Azure Storage Account

This is how to use Azure storage account as storage for ASP.NET identity.

  1. Create a new ASP.NET Core Web App

  2. From Additional information dialog select authentication type Individual Accounts

  3. Install AspNetCore.Identity.Stores.AzureStorageAccount package from NuGet manager.

  4. In Startup.cs replace the code inside ConfigureServices method with the folowing code

    using AspNetCore.Identity.Stores;
    using AspNetCore.Identity.Stores.AzureStorageAccount.Extensions;
    //Adds data protection services, needed to protect the identity personal data
    //Configure identity repository connection
    services.Configure<IdentityStoresOptions>(options => options
    services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
        .AddAzureStorageAccountStores(); //Add Identity stores
  5. In appsettings.json update DefaultConnection with Azure Storage Account connection string

    NOTE: For local development you may use "UseDevelopmentStorage=true" as connection string to connect to Azure storage emulator.


As shown in the code snippet from point 4, IdentityStoresOptions has an extension method UseAzureStorageAccount to configure the connection and it has 2 parameters:

  • connectionString: To specify the connection string of CosmosDB instance.
  • tableName (optinal): To specify the table which will be used, the default value is AspNetIdentity

Note: If the specified table not exists, it will get created on startup.

See more:

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 90 5/17/2022
1.0.3 159 9/17/2021
1.0.2 149 9/2/2021
1.0.1 146 8/19/2021
1.0.0 377 7/31/2021