![]() |
VOOZH | about |
dotnet add package Breakdance.Azurite --version 8.1.0-CI-20260115-212453
NuGet\Install-Package Breakdance.Azurite -Version 8.1.0-CI-20260115-212453
<PackageReference Include="Breakdance.Azurite" Version="8.1.0-CI-20260115-212453" />
<PackageVersion Include="Breakdance.Azurite" Version="8.1.0-CI-20260115-212453" />Directory.Packages.props
<PackageReference Include="Breakdance.Azurite" />Project file
paket add Breakdance.Azurite --version 8.1.0-CI-20260115-212453
#r "nuget: Breakdance.Azurite, 8.1.0-CI-20260115-212453"
#:package Breakdance.Azurite@8.1.0-CI-20260115-212453
#addin nuget:?package=Breakdance.Azurite&version=8.1.0-CI-20260115-212453&prereleaseInstall as a Cake Addin
#tool nuget:?package=Breakdance.Azurite&version=8.1.0-CI-20260115-212453&prereleaseInstall as a Cake Tool
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.
dotnet add package Breakdance.Azurite
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 ...
}
}
[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
}
}
[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() { /* ... */ }
}
[TestClass]
public class DiskPersistedTests : AzuriteTestBase
{
protected override bool UseInMemoryPersistence => false;
protected override string Location => @"C:\temp\azurite-data";
[TestMethod]
public void TestWithDiskStorage() { /* ... */ }
}
| 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 |
| 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 |
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).
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()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();
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);
Install Node.js from https://nodejs.org/ and ensure npm is in your PATH.
Azurite.StandardOutput and Azurite.StandardError for diagnosticsStartupTimeoutSeconds if startup is slowIf you get port conflicts with manually specified ports, use dynamic allocation (don't set BlobPort, QueuePort, or TablePort).
MIT License - see LICENSE file for details
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. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 8.1.0-CI-20260115-212453 | 76 | 1/16/2026 |
| 8.1.0-CI-20260114-023702 | 55 | 1/14/2026 |
| 8.1.0-CI-20260114-005208 | 60 | 1/14/2026 |
| 8.1.0-CI-20260113-225202 | 52 | 1/14/2026 |
| 8.1.0-CI-20260112-153145 | 62 | 1/12/2026 |
| 8.1.0-CI-20260112-035252 | 63 | 1/12/2026 |
| 8.0.0-CI-20251226-164344 | 67 | 12/26/2025 |
| 8.0.0-CI-20251224-234751 | 153 | 12/25/2025 |
| 8.0.0-CI-20251221-010745 | 101 | 12/21/2025 |
| 8.0.0-CI-20251127-002735 | 180 | 11/27/2025 |
| 8.0.0-CI-20251126-154301 | 164 | 11/26/2025 |
| 8.0.0-CI-20251125-225520 | 161 | 11/26/2025 |
| 8.0.0-CI-20251125-223343 | 162 | 11/26/2025 |
Initial release with support for Blob, Queue, and Table services. In-memory persistence by default, dynamic port allocation for parallel test execution.