VOOZH about

URL: https://www.nuget.org/packages/Breakdance.Azurite/

⇱ NuGet Gallery | Breakdance.Azurite 8.1.0-CI-20260115-212453




👁 Image
Breakdance.Azurite 8.1.0-CI-20260115-212453

Prefix Reserved
This is a prerelease version of Breakdance.Azurite.
dotnet add package Breakdance.Azurite --version 8.1.0-CI-20260115-212453
 
 
NuGet\Install-Package Breakdance.Azurite -Version 8.1.0-CI-20260115-212453
 
 
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="Breakdance.Azurite" Version="8.1.0-CI-20260115-212453" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Breakdance.Azurite" Version="8.1.0-CI-20260115-212453" />
 
Directory.Packages.props
<PackageReference Include="Breakdance.Azurite" />
 
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 Breakdance.Azurite --version 8.1.0-CI-20260115-212453
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Breakdance.Azurite, 8.1.0-CI-20260115-212453"
 
 
#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 Breakdance.Azurite@8.1.0-CI-20260115-212453
 
 
#: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=Breakdance.Azurite&version=8.1.0-CI-20260115-212453&prerelease
 
Install as a Cake Addin
#tool nuget:?package=Breakdance.Azurite&version=8.1.0-CI-20260115-212453&prerelease
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

CloudNimble.Breakdance.Azurite

A test harness for Azurite (Azure Storage Emulator) that integrates seamlessly with the Breakdance testing framework. Provides in-memory Azure Storage emulation with automatic lifecycle management and support for parallel test execution.

Features

  • In-Memory by Default: No disk I/O or file cleanup required
  • Parallel Test Safe: Dynamic port allocation prevents conflicts
  • Multi-Service Support: Blob, Queue, and Table services
  • Automatic Lifecycle: Start/stop managed through test hooks
  • Zero Configuration: Works out of the box with sensible defaults
  • Flexible: Override settings for custom scenarios

Requirements

  • Node.js: Required to run Azurite (npm must be in PATH)
  • .NET 8.0+: Target framework support for net8.0, net9.0, net10.0

Installation

dotnet add package Breakdance.Azurite

Quick Start

Basic Usage

using CloudNimble.Breakdance.Azurite;
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
public class MyStorageTests : AzuriteTestBase
{
 [TestMethod]
 public async Task TestBlobStorage()
 {
 // Azurite is already running!
 var connectionString = ConnectionString;

 var blobClient = new BlobServiceClient(connectionString);
 var container = blobClient.GetBlobContainerClient("test");
 await container.CreateAsync();

 // ... your test code ...
 }
}

Blob Service Only

[TestClass]
public class BlobTests : AzuriteTestBase
{
 // Only start the Blob service
 protected override AzuriteServiceType Services => AzuriteServiceType.Blob;

 [TestMethod]
 public void TestBlobs()
 {
 BlobEndpoint.Should().NotBeNullOrEmpty();
 QueueEndpoint.Should().BeNull(); // Not started
 }
}

Custom Configuration

[TestClass]
public class CustomAzuriteTests : AzuriteTestBase
{
 protected override bool SilentMode => false; // Show access logs
 protected override int StartupTimeoutSeconds => 60; // Longer timeout
 protected override int? ExtentMemoryLimitMB => 100; // Limit memory

 [TestMethod]
 public void MyTest() { /* ... */ }
}

Disk Persistence (Optional)

[TestClass]
public class DiskPersistedTests : AzuriteTestBase
{
 protected override bool UseInMemoryPersistence => false;
 protected override string Location => @"C:\temp\azurite-data";

 [TestMethod]
 public void TestWithDiskStorage() { /* ... */ }
}

Available Properties

Property Description
Azurite The AzuriteInstance object
BlobEndpoint HTTP URL for Blob service
QueueEndpoint HTTP URL for Queue service
TableEndpoint HTTP URL for Table service
BlobPort Port number for Blob service
QueuePort Port number for Queue service
TablePort Port number for Table service
ConnectionString Azure Storage connection string

Configurable Options

Option Default Description
Services AzuriteServiceType.All Which services to start
UseInMemoryPersistence true Use in-memory storage
SilentMode true Disable access logs
StartupTimeoutSeconds 30 Startup timeout
ExtentMemoryLimitMB null Memory limit (unlimited)
Location null Disk storage path

Parallel Test Execution

The library automatically handles port allocation to support multiple test instances running simultaneously:

// These can run in parallel without conflicts
[TestClass]
public class ParallelTest1 : AzuriteTestBase { /* ... */ }

[TestClass]
public class ParallelTest2 : AzuriteTestBase { /* ... */ }

[TestClass]
public class ParallelTest3 : AzuriteTestBase { /* ... */ }

Each test class gets its own Azurite instance with unique ports (starting from 11000).

Lifecycle Hooks

Choose the appropriate lifecycle for your tests:

// Per-test (default)
public override void TestSetup() { /* Azurite starts */ }
public override void TestTearDown() { /* Azurite stops */ }

// Per-class
public override void ClassSetup() { /* Azurite starts once */ }
public override void ClassTearDown() { /* Azurite stops once */ }

// Per-assembly
public override void AssemblySetup() { /* Azurite starts once */ }
public override void AssemblyTearDown() { /* Azurite stops once */ }

Async versions are also available:

  • TestSetupAsync() / TestTearDownAsync()
  • ClassSetupAsync() / ClassTearDownAsync()
  • AssemblySetupAsync() / AssemblyTearDownAsync()

Advanced Usage

Direct Instance Control

var config = new AzuriteConfiguration
{
 Services = AzuriteServiceType.Blob | AzuriteServiceType.Queue,
 InMemoryPersistence = true,
 Silent = true,
 BlobPort = 15000 // Specific port
};

var azurite = new AzuriteInstance(config);
await azurite.StartAsync();

// Use azurite.BlobEndpoint, azurite.ConnectionString, etc.

await azurite.StopAsync();
azurite.Dispose();

Port Manager

var portManager = new PortManager();

// Allocate a single port
var port = portManager.GetAvailablePort();

// Allocate multiple ports
var ports = portManager.GetAvailablePorts(3);

// Release when done
portManager.ReleasePorts(ports);

Troubleshooting

"npm is not installed"

Install Node.js from https://nodejs.org/ and ensure npm is in your PATH.

"Azurite failed to start"

  1. Check Azurite.StandardOutput and Azurite.StandardError for diagnostics
  2. Increase StartupTimeoutSeconds if startup is slow
  3. Verify Node.js and npm are properly installed

Port Conflicts

If you get port conflicts with manually specified ports, use dynamic allocation (don't set BlobPort, QueuePort, or TablePort).

License

MIT License - see LICENSE file for details

Contributing

Contributions welcome! Please submit issues and pull requests to the Breakdance repository.

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows 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.

Initial release with support for Blob, Queue, and Table services. In-memory persistence by default, dynamic port allocation for parallel test execution.