MVFC.Aspire.Helpers.CloudStorage 7.3.3

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

MVFC.Aspire.Helpers.CloudStorage

🇧🇷 Leia em Português

CI codecov License Platform NuGet Version NuGet Downloads

Helpers for integrating with Google Cloud Storage (GCS emulator) in .NET Aspire projects.

Motivation

When you need object storage locally, you usually:

  • Spin up a GCS/S3‑compatible emulator by hand.
  • Mount folders manually as bucket data.
  • Hard‑code emulator URLs and ports in your services.

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

  • Keep the emulator configuration aligned with your applications.
  • Remember which folder is mounted for which bucket.
  • Inject the emulator host/port into your projects.

MVFC.Aspire.Helpers.CloudStorage provides:

  • AddCloudStorage(...) to start the GCS emulator.
  • WithBucketFolder(...) to mount a local folder as data.
  • WithReference(...) to inject STORAGE_EMULATOR_HOST into your project.

Overview

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

  • Add and integrate the GCS emulator.
  • Allow optional persistence of buckets via bind mount.

Project Structure

Features

  • Adds the GCS emulator to the AppHost.
  • Allows bucket persistence configuration via a local folder.
  • Extension methods to facilitate AppHost configuration.
  • Exposes emulator functionalities on port 4443.

Compatible Images:

  • fsouza/fake-gcs-server

Installation

dotnet add package MVFC.Aspire.Helpers.CloudStorage

Quick Aspire usage (AppHost)

using Aspire.Hosting;
using MVFC.Aspire.Helpers.CloudStorage;

var builder = DistributedApplication.CreateBuilder(args);

var cloudStorage = builder.AddCloudStorage("cloud-storage")
    .WithBucketFolder("./bucket-data");

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

await builder.Build().RunAsync();

Provisioning diagram

sequenceDiagram
    participant Aspire as .NET Aspire
    participant Container as GCP Storage Emulator
    participant Configurator as Cloud Storage Processor
    
    Aspire->>Container: Start container (fsouza/fake-gcs-server)
    Container-->>Aspire: Ready (port 4443 available)
    Aspire->>Configurator: Trigger OnResourceReady
    Configurator->>Container: Create Buckets
    Configurator-->>Aspire: Provisioning Completed
    Aspire->>App: Start App with STORAGE_EMULATOR_HOST

Fluent methods

Method Description
WithDockerImage(image, tag) Overrides the Docker image used.
WithBucketFolder(localPath) Configures a bind mount from a local folder to persist buckets.

AddCloudStorage parameters

Parameter Type Default Description
name string Resource name.
port int 4443 Emulator port.

Mounting a bucket from folders

It is possible to mount a GCS emulator bucket using a local folder for data persistence. The specified folder will be used by the emulator as persistent storage for the buckets. Ensure the folder exists and has read/write permissions.

Example folder structure

graph TD
    A["./bucket-data"]
    B["my-bucket"]
    C["object1.txt"]
    D["object2.json"]

    A --> B
    B --> C
    B --> D

Emulator endpoints

  • List buckets: http://localhost:4443/storage/v1/b
  • List objects in a bucket: http://localhost:4443/storage/v1/b/{bucket-name}/o

Environment variable injected

The WithReference method automatically injects:

  • STORAGE_EMULATOR_HOST – emulator address for your application.

Requirements

  • .NET 9+
  • Aspire.Hosting >= 9.5.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 (1)

Showing the top 1 NuGet packages that depend on MVFC.Aspire.Helpers.CloudStorage:

Package Downloads
MVFC.Aspire.Helpers.Mongo

Helpers para integração com MongoDB em projetos .NET Aspire, incluindo suporte a Replica Set e inicialização automática.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.3.3 0 3/31/2026
7.3.2 39 3/30/2026
7.3.1 40 3/30/2026
7.3.0 41 3/30/2026
7.2.2 41 3/29/2026
7.2.1 43 3/29/2026
7.2.0 38 3/29/2026
7.1.0 96 3/22/2026
6.4.4 93 3/21/2026
6.4.3 100 3/15/2026
6.4.2 103 3/15/2026
6.4.1 96 3/10/2026
6.4.0 93 3/9/2026
6.3.0 98 3/8/2026
6.2.0 95 3/8/2026
6.1.1 91 3/7/2026
6.0.0 97 3/7/2026
5.1.0 104 2/28/2026
5.0.3 107 2/17/2026
5.0.2 106 2/17/2026
Loading failed