MVFC.Aspire.Helpers.GcpFirestore 10.1.0

dotnet add package MVFC.Aspire.Helpers.GcpFirestore --version 10.1.0
                    
NuGet\Install-Package MVFC.Aspire.Helpers.GcpFirestore -Version 10.1.0
                    
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="MVFC.Aspire.Helpers.GcpFirestore" Version="10.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MVFC.Aspire.Helpers.GcpFirestore" Version="10.1.0" />
                    
Directory.Packages.props
<PackageReference Include="MVFC.Aspire.Helpers.GcpFirestore" />
                    
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 MVFC.Aspire.Helpers.GcpFirestore --version 10.1.0
                    
#r "nuget: MVFC.Aspire.Helpers.GcpFirestore, 10.1.0"
                    
#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 MVFC.Aspire.Helpers.GcpFirestore@10.1.0
                    
#: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=MVFC.Aspire.Helpers.GcpFirestore&version=10.1.0
                    
Install as a Cake Addin
#tool nuget:?package=MVFC.Aspire.Helpers.GcpFirestore&version=10.1.0
                    
Install as a Cake Tool

MVFC.Aspire.Helpers.GcpFirestore

🇧🇷 Leia em Português

CI codecov License Platform NuGet Version NuGet Downloads

Helpers for integrating with Google Cloud Firestore in .NET Aspire projects, including support for the emulator.

Motivation

Working with Google Cloud Firestore locally usually means:

  • Spinning up an emulator container by hand.
  • Remembering ports, project IDs and environment variables.
  • Manually configuring readiness checks for the emulator.

With .NET Aspire you can define containers, but you still need to:

  • Configure the emulator image and its ports.
  • Keep emulator environment variables in sync across projects.
  • Define project configurations in a consistent way before the application runs.

MVFC.Aspire.Helpers.GcpFirestore provides:

  • AddGcpFirestore(...) to start the emulator.
  • WithFirestoreConfigs(...) to describe project configurations in code.
  • WithReference(...) to wire projects to the emulator and inject connection configurations automatically.

Overview

This project facilitates the configuration and integration of Google Cloud Firestore in distributed .NET Aspire applications, providing extension methods to:

  • Add the Google Cloud Firestore emulator.
  • Configure project IDs automatically upon startup.
  • Properly inject the emulator host connection string for automatic detection by Firestore clients.

Firestore emulator advantages

  • Simulates Firestore databases locally for development and testing.
  • Allows testing data operations without depending on Google Cloud infrastructure.
  • Facilitates development of robust data storage implementations.

Compatible Images

  • Emulator:
    • mtlynch/firestore-emulator (Default in Aspire helper)

Project Structure

Features

  • Adds the Google Cloud Firestore emulator.
  • Configures project IDs according to configuration.
  • Native TCP port health checks ensure the emulator is fully ready before projects start consuming it.
  • Extension methods to facilitate AppHost configuration.

Installation

dotnet add package MVFC.Aspire.Helpers.GcpFirestore

Quick Aspire usage (AppHost)

using Aspire.Hosting;
using MVFC.Aspire.Helpers.GcpFirestore;
using MVFC.Aspire.Helpers.GcpFirestore.Models;

var builder = DistributedApplication.CreateBuilder(args);

var firestoreConfig = new FirestoreConfig(
    projectId: "test-project");

var firestore = builder.AddGcpFirestore("gcp-firestore")
                       .WithFirestoreConfigs(firestoreConfig);

builder.AddProject<Projects.MVFC_Aspire_Helpers_Playground_Api>("api-example")
       .WithReference(firestore)
       .WaitFor(firestore);

await builder.Build().RunAsync();

Emulated Resources Configuration

FirestoreConfig

Parameter Type Default Description
projectId string — GCP project ID used by Firestore.

Ports

  • HTTP Port: 8084 (mapped to internal port 8080 in the container)

Provisioning diagram

sequenceDiagram
    participant Aspire as .NET Aspire
    participant Container as Firestore Emulator Container
    participant Configurator as Config Processor
    
    Aspire->>Container: Start container (mtlynch/firestore-emulator)
    Container-->>Aspire: Ready (HTTP port 8084 available)
    Aspire->>Configurator: Trigger OnResourceReady
    Configurator-->>Aspire: Provisioning Completed
    Aspire->>App: Start App with FIRESTORE_EMULATOR_HOST

Public methods

  • AddGcpFirestore – adds the emulator container.
  • WithFirestoreConfigs – configures project IDs.
  • WithDockerImage – replaces the Docker image used by the resource.
  • WithReference – wires projects to the emulator and sets the FIRESTORE_EMULATOR_HOST environment variable automatically.

Requirements

  • .NET 9+
  • Aspire.Hosting >= 13.5.3
  • Docker running locally
  • Google.Cloud.Firestore >= 4.4.0

License

Apache-2.0

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 is compatible.  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

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
10.1.0 117 8/31/2026
10.0.0 108 8/30/2026
9.0.5 109 8/28/2026
9.0.4 128 6/26/2026
9.0.3 126 4/12/2026
9.0.2 119 4/12/2026
9.0.1 125 4/12/2026
9.0.0 121 4/12/2026