Franz.Common.AzureCosmosDB 1.6.19

dotnet add package Franz.Common.AzureCosmosDB --version 1.6.19
                    
NuGet\Install-Package Franz.Common.AzureCosmosDB -Version 1.6.19
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Franz.Common.AzureCosmosDB" Version="1.6.19" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Franz.Common.AzureCosmosDB" Version="1.6.19" />
                    
Directory.Packages.props
<PackageReference Include="Franz.Common.AzureCosmosDB" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Franz.Common.AzureCosmosDB --version 1.6.19
                    
#r "nuget: Franz.Common.AzureCosmosDB, 1.6.19"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Franz.Common.AzureCosmosDB@1.6.19
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Franz.Common.AzureCosmosDB&version=1.6.19
                    
Install as a Cake Addin
#tool nuget:?package=Franz.Common.AzureCosmosDB&version=1.6.19
                    
Install as a Cake Tool

Franz.Common.AzureCosmosDB

A specialized persistence library within the Franz Framework, providing seamless integration with Azure Cosmos DB. This package extends the polyglot persistence philosophy of the framework by enabling NoSQL storage, outbox pattern messaging, and dead-letter handling alongside existing SQL and Mongo providers.


Features

  • Cosmos DB Bootstrapping:

    • ServiceCollectionExtensions to configure and register Cosmos DB dependencies via configuration.
    • Automatic registration of CosmosClient, Database, and container-level resources.
  • Outbox & Dead-Letter Messaging:

    • CosmosDBMessageStore implements IMessageStore from Franz.Common.Messaging.Storage, enabling reliable message persistence, retries, and dead-letter handling.
  • Repository Support:

    • Generic repository pattern (ICosmosRepository<T>) for CRUD operations.
    • Partition key awareness and container management out-of-the-box.
  • Config-Driven:

    • Centralized setup through appsettings.json (CosmosDb:ConnectionString, CosmosDb:DatabaseName).
  • Polyglot Persistence:

    • Aligns with the same philosophy as Franz.Common.EntityFramework and Franz.Common.MongoDB, allowing developers to swap or combine providers effortlessly.

Version Information

  • Current Version: 1.6.19
  • Part of the private Franz Framework ecosystem.
  • Extended capacities: Cosmos DB support introduced in 1.6.2.

Installation

From Private Azure Feed

dotnet nuget add source "https://your-private-feed-url" \
  --name "AzurePrivateFeed" \
  --username "YourAzureUsername" \
  --password "YourAzurePassword" \
  --store-password-in-clear-text

Install the package:

dotnet add package Franz.Common.AzureCosmosDB

Usage

1. Configure Cosmos Database

In appsettings.json:

{
  "CosmosDb": {
    "ConnectionString": "AccountEndpoint=https://your-account.documents.azure.com:443/;AccountKey=your-key;",
    "DatabaseName": "FranzAppDb"
  }
}

2. Register Cosmos in DI

using Franz.Common.Cosmos.Extensions;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddCosmosDatabase(Configuration);  
        services.AddCosmosMessageStore(
            Configuration["CosmosDb:ConnectionString"],
            Configuration["CosmosDb:DatabaseName"]);
    }
}

3. Outbox & Dead-Letter Messaging

public class MyService
{
    private readonly IMessageStore _messageStore;

    public MyService(IMessageStore messageStore)
    {
        _messageStore = messageStore;
    }

    public async Task SendMessageAsync()
    {
        var message = new Message("Hello from Franz!");
        await _messageStore.SaveAsync(message);
    }
}

Dependencies

  • Franz.Common.Messaging: Contracts (Message, StoredMessage)
  • Franz.Common.Messaging.Storage: IMessageStore abstraction
  • Microsoft.Azure.Cosmos: Cosmos DB SDK

Contributing

This package is part of a private framework. Contributions are limited to the internal development team.

  1. Clone the repository @ https://github.com/bestacio89/Franz.Common/
  2. Create a feature branch.
  3. Submit a pull request for review.

License

Licensed under the MIT License. See the LICENSE file for more details.


Changelog

Version 1.6.2

  • Introduced Azure Cosmos DB integration.
  • Added CosmosDBMessageStore implementing IMessageStore.
  • Added ICosmosRepository<T> for generic repository patterns.
  • Enabled Outbox / Dead-Letter pattern in Cosmos DB.
  • Extended polyglot persistence bootstrapper to include Cosmos alongside SQL and Mongo.
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Franz.Common.AzureCosmosDB:

Package Downloads
Franz.Common.Messaging.EntityFramework

Shared utility library for the Franz Framework.

Franz.Common.Http.EntityFramework

Shared utility library for the Franz Framework.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.6.19 0 10/25/2025
1.6.15 175 10/20/2025
1.6.14 179 10/15/2025
1.6.3 181 10/9/2025
1.6.2 178 10/7/2025