PinguApps.Aspire.Hosting.Bunny.Storage
1.0.1
dotnet add package PinguApps.Aspire.Hosting.Bunny.Storage --version 1.0.1
NuGet\Install-Package PinguApps.Aspire.Hosting.Bunny.Storage -Version 1.0.1
<PackageReference Include="PinguApps.Aspire.Hosting.Bunny.Storage" Version="1.0.1" />
<PackageVersion Include="PinguApps.Aspire.Hosting.Bunny.Storage" Version="1.0.1" />
<PackageReference Include="PinguApps.Aspire.Hosting.Bunny.Storage" />
paket add PinguApps.Aspire.Hosting.Bunny.Storage --version 1.0.1
#r "nuget: PinguApps.Aspire.Hosting.Bunny.Storage, 1.0.1"
#:package PinguApps.Aspire.Hosting.Bunny.Storage@1.0.1
#addin nuget:?package=PinguApps.Aspire.Hosting.Bunny.Storage&version=1.0.1
#tool nuget:?package=PinguApps.Aspire.Hosting.Bunny.Storage&version=1.0.1
PinguApps.Aspire.Hosting.Bunny.Storage
PinguApps.Aspire.Hosting.Bunny.Storage lets an Aspire AppHost publish a normal Azure Blob container to Bunny Storage during aspire deploy.
- Hosting package:
PinguApps.Aspire.Hosting.Bunny.Storage - Runtime package:
PinguApps.Bunny.Storage - Distribution: NuGet for C# and TypeScript AppHosts
- Tested Aspire baseline:
13.4.6 - Local behaviour: Azure Blob Storage through Azurite
- Deploy behaviour: opt-in Bunny Storage create/adopt validation, with optional Pull Zone creation
Install
AppHost:
dotnet add package PinguApps.Aspire.Hosting.Bunny.Storage
Server-side application:
dotnet add package PinguApps.Bunny.Storage
Minimal C# Example
using Aspire.Hosting;
using Aspire.Hosting.Bunny.Storage;
var builder = DistributedApplication.CreateBuilder(args);
var bunnyApiKey = builder.AddParameter("bunny-api-key", secret: true);
var media = builder.AddAzureStorage("storage")
.RunAsEmulator()
.AddBlobContainer("media", "media")
.PublishToBunny("myapp-media", bunnyApiKey, configure: options =>
{
options.Region = BunnyStorageRegion.De;
options.CreatePullZone = true;
options.PullZoneName = "myapp-media";
});
builder.AddProject<Projects.Web>("web")
.WithReference(media)
.WithObjectStorage(media);
builder.Build().Run();
Register the runtime abstraction in the server-side application:
builder.Services.AddObjectStorage(builder.Configuration);
Application code consumes IObjectStorage or IObjectStorageProvider and stores object keys such as uploads/avatar.png, not absolute URLs.
Minimal TypeScript AppHost Example
TypeScript AppHosts consume the same NuGet package through Aspire's generated module flow:
{
"packages": {
"Aspire.Hosting.Azure.Storage": "13.4.6",
"PinguApps.Aspire.Hosting.Bunny.Storage": "<package version>"
}
}
aspire restore --non-interactive
import {
BunnyStorageOwnershipMode,
BunnyStorageRegion,
createBuilder,
} from "./.aspire/modules/aspire.mjs";
const builder = await createBuilder();
const zoneName = await builder.addParameter("bunny-storage-zone-name");
const apiKey = await builder.addParameter("bunny-api-key", { secret: true });
const storage = await builder.addAzureStorage("storage").runAsEmulator();
let media = await storage.addBlobContainer("media", { blobContainerName: "media" });
media = await media.publishToBunny(zoneName, apiKey, {
ownershipMode: BunnyStorageOwnershipMode.CreateOrAdopt,
region: BunnyStorageRegion.De,
createPullZone: true,
pullZoneName: "myapp-media",
});
let web = await builder.addProject("web", "../Web/Web.csproj");
web = await web.withReference(media);
web = await web.withObjectStorage(media);
await (await builder.build()).run();
Deploy Inputs
| Input | Secret | Purpose |
|---|---|---|
| Storage-zone name | No | Explicit Bunny storage-zone name and stable remote identity. |
bunny-api-key |
Yes | Infrastructure-only Bunny account API key. |
For parameter-backed non-interactive deploys:
$env:Parameters__bunny_storage_zone_name = "myapp-media"
$env:Parameters__bunny_api_key = $env:BUNNY_API_KEY
aspire deploy --non-interactive --pipeline-log-level debug
The Bunny account API key is never exposed to application resources. Deployed applications receive the storage-zone access key instead.
Behaviour Summary
The built-in AzureBlobStorageContainerResource remains the local resource of record. PublishToBunny(...) or publishToBunny(...) adds deploy-time intent. WithObjectStorage(...) switches application configuration between local Azure Blob Storage and deployed Bunny Storage without inventing an Azure connection string for Bunny.
The package never deletes Bunny resources automatically. Repeated deployments validate cached remote identity, ownership mode, region, replication regions, and Pull Zone linkage before reusing resources.
Documentation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Aspire.Hosting (>= 13.4.6)
- Aspire.Hosting.Azure.Storage (>= 13.4.6)
- Azure.Storage.Blobs (>= 12.28.0)
- MessagePack (>= 3.1.7)
- Microsoft.Extensions.Configuration (>= 10.0.8)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.8)
- Microsoft.Extensions.DependencyInjection (>= 10.0.8)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Http (>= 10.0.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.