MVFC.Aspire.Helpers.GcpBigQuery 10.1.0

dotnet add package MVFC.Aspire.Helpers.GcpBigQuery --version 10.1.0
                    
NuGet\Install-Package MVFC.Aspire.Helpers.GcpBigQuery -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.GcpBigQuery" 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.GcpBigQuery" Version="10.1.0" />
                    
Directory.Packages.props
<PackageReference Include="MVFC.Aspire.Helpers.GcpBigQuery" />
                    
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.GcpBigQuery --version 10.1.0
                    
#r "nuget: MVFC.Aspire.Helpers.GcpBigQuery, 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.GcpBigQuery@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.GcpBigQuery&version=10.1.0
                    
Install as a Cake Addin
#tool nuget:?package=MVFC.Aspire.Helpers.GcpBigQuery&version=10.1.0
                    
Install as a Cake Tool

MVFC.Aspire.Helpers.GcpBigQuery

🇧🇷 Leia em Português

CI codecov License Platform NuGet Version NuGet Downloads

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

Motivation

Working with Google Cloud BigQuery locally usually means:

  • Spinning up an emulator container by hand.
  • Remembering ports, project IDs, datasets, and environment variables.
  • Manually creating datasets/tables and seeding data.

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

  • Configure the emulator image and its REST/gRPC ports.
  • Keep emulator environment variables in sync across projects.
  • Define datasets and seed mock data in a consistent way before the application runs.

MVFC.Aspire.Helpers.GcpBigQuery provides:

  • AddGcpBigQuery(...) to start the emulator.
  • WithBigQueryConfigs(...) to describe projects and default datasets in code.
  • WithDataSeed(...) to automatically load tables and data from a local YAML file.
  • WithReference(...) to wire projects to the emulator and inject connection configurations automatically.

Overview

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

  • Add the Google Cloud BigQuery emulator.
  • Configure projects and datasets automatically upon startup.
  • Seed data from a YAML dump file right after creation.
  • Properly inject the emulator host connection string for automatic detection by BigQuery SDK clients.

BigQuery emulator advantages

  • Simulates BigQuery databases locally for development and testing.
  • Allows testing schema changes and query executions without depending on Google Cloud infrastructure.
  • Facilitates development of robust data warehouse implementations locally.

Compatible Images

  • Emulator:
    • ghcr.io/goccy/bigquery-emulator (Default in Aspire helper)

Project Structure

Features

  • Adds the Google Cloud BigQuery emulator.
  • Creates projects and datasets according to configuration.
  • Supports YAML seeding for initial schema and data.
  • Exposes both REST and gRPC endpoints natively.
  • Extension methods to facilitate AppHost configuration.

Installation

dotnet add package MVFC.Aspire.Helpers.GcpBigQuery

Quick Aspire usage (AppHost)

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

var builder = DistributedApplication.CreateBuilder(args);

var bigQueryConfig = new BigQueryConfig(
    ProjectId: "test-project",
    Dataset: "test_dataset"
);

var bigQuery = builder.AddGcpBigQuery("gcp-bigquery")
                      .WithBigQueryConfigs(bigQueryConfig)
                      .WithDataSeed("./bigquery-data/dump.yaml");

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

await builder.Build().RunAsync();

Emulated Resources Configuration

BigQueryConfig

Parameter Type Default Description
ProjectId string — GCP project ID.
Dataset string? null Optional default dataset name.

Ports

  • REST Port: 9050
  • gRPC Port: 9060

Provisioning diagram

sequenceDiagram
    participant Aspire as .NET Aspire
    participant Container as BigQuery Emulator Container
    
    Aspire->>Container: Start container (ghcr.io/goccy/bigquery-emulator) with config flags & YAML mount
    Container-->>Aspire: Ready (REST port 9050 / gRPC port 9060 available)
    Aspire->>App: Start App with BIGQUERY_EMULATOR_HOST & BIGQUERY_EMULATOR_GRPC_HOST

Public methods

  • AddGcpBigQuery – adds the emulator container.
  • WithBigQueryConfigs – configures project and dataset arguments for the container.
  • WithDataSeed – sets a local YAML file to be mounted and loaded as seed data by the emulator.
  • WithDockerImage – allows overriding the default emulator image.
  • WithReference – wires projects to the emulator and sets the BIGQUERY_EMULATOR_HOST and BIGQUERY_EMULATOR_GRPC_HOST environment variables automatically.

Requirements

  • .NET 9+
  • Aspire.Hosting >= 13.5.3
  • Docker running locally
  • Google.Cloud.BigQuery.V2 >= 3.12.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 112 8/31/2026