DevelopmentHelpers.Storage.Core
10.0.0
See the version list below for details.
dotnet add package DevelopmentHelpers.Storage.Core --version 10.0.0
NuGet\Install-Package DevelopmentHelpers.Storage.Core -Version 10.0.0
<PackageReference Include="DevelopmentHelpers.Storage.Core" Version="10.0.0" />
<PackageVersion Include="DevelopmentHelpers.Storage.Core" Version="10.0.0" />
<PackageReference Include="DevelopmentHelpers.Storage.Core" />
paket add DevelopmentHelpers.Storage.Core --version 10.0.0
#r "nuget: DevelopmentHelpers.Storage.Core, 10.0.0"
#:package DevelopmentHelpers.Storage.Core@10.0.0
#addin nuget:?package=DevelopmentHelpers.Storage.Core&version=10.0.0
#tool nuget:?package=DevelopmentHelpers.Storage.Core&version=10.0.0
DevelopmentHelpers.Storage.Core
A small library to simplify working with Azure Blob Storage, Azure FileShare, and local filesystem directories. It provides an easy-to-use API for uploading, downloading and syncing entire directory structures and individual files. The library supports both local and Azure storage implementations and integrates with dependency injection.
Key features
- Unified
IStorageinterface with implementations for Azure Blob Storage and local filesystem. - Azure FileShare support via
IAzureFileStorageimplementation. - Upload/download entire directories and containers.
- Upload large files in chunks (resumable/large-file friendly).
- Container synchronization helpers (container-to-container and directory-to-container).
- Create ZIP archives from containers.
- Easy configuration using
appsettings.jsonand dependency injection.
Prerequisites
- .NET 10
- Azure Storage account (when using Azure implementations)
Quick start
- Add the project or NuGet package to your solution.
- Configure storage settings in
appsettings.json(example below). - Register services in
Program.cs/Startup.cs. - Inject
IStorageorIAzureFileStoragewhere needed and call methods.
Configuration (appsettings.json)
Keep the following structure in your appsettings.json under a DevelopmentHelpers section. The values shown are examples — replace them with your account details.
"DevelopmentHelpers": {
"AzureConfiguration": {
"AccountName": "Account-Name",
"AccountKey": "Account-Key",
"UseHttps": "True"
},
"AzureFileStorageConfiguration": {
"ConnectionString": "Connection-String",
"ShareName": "Share-Name"
}
}
Registering services (dependency injection)
In Program.cs or Startup.cs register the library services so you can resolve IStorage and IAzureFileStorage from DI. The library exposes an extension method to register required services.
// in Program.cs
services.AddAzureStorage(Configuration);
Note: AddAzureStorage reads the DevelopmentHelpers section from configuration and registers the appropriate implementations.
Basic usage examples
Create storage instances (examples)
// Using DI (recommended)
public class MyService
{
private readonly IStorage _storage;
private readonly IAzureFileStorage _fileStorage;
public MyService(IStorage storage, IAzureFileStorage fileStorage)
{
_storage = storage;
_fileStorage = fileStorage;
}
}
// Or instantiate manually for quick testing
var azureConfig = new Models.AzureConfiguration
{
AccountName = "...",
AccountKey = "...",
UseHttps = true
};
var logger = ConfigHelper.Instance.LoggerFactory.CreateLogger<AzureStorage>();
IStorage storage = new AzureStorage(azureConfig, logger);
IStorage localStorage = new FileSystemStorage(azureConfig /* or local config */, logger);
IAzureFileStorage fileStorage = new AzureFileStorage(/* AzureFileStorageConfiguration */, logger);
Uploading and downloading
// Upload a single file
var fileInfo = new FileInfo("/path/to/file.txt");
var blobUrl = await _storage.UploadFileAsync(fileInfo, MimeTypes.txt, "my-container");
// Upload a Directory
await _storage.UploadDirectoryAsync(new DirectoryInfo("/path/to/folder"), "my-container");
// Download a file (by blob URL)
var downloaded = await _storage.DownloadToFileAsync(blobUrl, "/local/download/path");
// Download entire container to local folder
await _storage.DownloadContainer("my-container", "/local/download/path");
// Create a zip from a container
var zipPath = await _storage.CreateZipFromContainerAsync("my-container", "/tmp", "archive.zip");
Chunked uploads (large files)
// Upload large file in chunks
var uri = await _storage.UploadInChunks(fullFilePath, "container-name", "file-name.txt", MimeTypes.txt);
Checking blobs and containers
// Check existence
bool exists = await _storage.BlobExistsAsync(blobUrl);
// Create a container if not exists
var response = await _storage.CreateContainerAsync("container-name", publicAccess: false);
// List containers
var containers = await _storage.GetContainersAsync();
Sync helpers
The library includes helpers for synchronizing between containers or from a directory to a container.
// Container to container sync
var syncHelper = new ContainerToContainerSyncHelper(sourceStorage, targetStorage);
var (success, message) = await syncHelper.SyncContainersAsync("source", "target", deleteExtraFiles: false, localTempPath: "/tmp");
// Directory to container sync helper
var directorySyncHelper = new DirectoryToContainerSyncHelper(storage);
var result = await directorySyncHelper.GetBlobUrlListExistInTargetButNotInSourceAsync(sourceDirectoryPath, "target-container");
Tips and best practices
- Use
UploadInChunksfor large files to avoid memory issues. - Keep container names lowercase when interacting with Azure Blob Storage.
- When uploading directories with nested folders, use consistent path separators (
/) for blob names. - Clean up temporary local directories after operations to avoid consuming disk space.
Testing
The DevelopmentHelpers.Storage.Core.Tests project includes a comprehensive set of integration tests that exercise common flows such as uploading/downloading files, chunked uploads, container sync and zip creation. The tests expect an Azure Storage account configured via ConfigHelper in test settings. You can inspect the test project for sample usage patterns.
Contributing
Contributions and issues are welcome. Please open an issue describing the problem or the feature request and submit pull requests for fixes.
License
Include your license information here (e.g., MIT) or a note about internal use.
If you need a targeted example or the exact code snippet for a specific scenario, describe the scenario and I will add a short sample.
| 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
- Azure.Storage.Blobs (>= 12.26.0)
- Azure.Storage.Files.Shares (>= 12.24.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0)
- Microsoft.Extensions.Logging (>= 10.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.0)
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.0.1 | 41 | 12/16/2025 |
| 10.0.0 | 194 | 12/3/2025 |
| 9.0.8 | 168 | 9/26/2025 |
| 9.0.6 | 269 | 8/27/2025 |
| 9.0.5 | 267 | 8/8/2025 |
| 9.0.4 | 293 | 5/20/2025 |
| 9.0.3 | 325 | 5/13/2025 |
| 9.0.2 | 234 | 4/22/2025 |
| 9.0.1 | 234 | 4/6/2025 |
| 9.0.0 | 294 | 11/20/2024 |
| 7.0.19 | 198 | 11/14/2024 |
| 7.0.18 | 438 | 10/11/2024 |
| 7.0.17 | 191 | 10/9/2024 |
| 7.0.16 | 204 | 9/30/2024 |
| 7.0.15 | 282 | 8/13/2024 |
| 7.0.14 | 215 | 8/2/2024 |
| 7.0.11 | 197 | 5/31/2024 |
| 7.0.10 | 199 | 5/23/2024 |
| 7.0.9 | 186 | 5/23/2024 |
| 7.0.8 | 359 | 4/10/2024 |
| 7.0.7 | 396 | 2/16/2024 |
| 7.0.6 | 217 | 2/7/2024 |
| 7.0.5 | 193 | 1/29/2024 |
| 7.0.4 | 206 | 1/16/2024 |
| 7.0.3 | 233 | 12/26/2023 |
| 7.0.2 | 229 | 12/15/2023 |
| 7.0.1 | 203 | 12/15/2023 |
| 7.0.0 | 253 | 11/14/2023 |
| 6.0.5 | 253 | 10/23/2023 |
| 6.0.4 | 328 | 8/2/2023 |
| 6.0.3 | 224 | 7/27/2023 |
| 6.0.2 | 245 | 7/11/2023 |
| 6.0.1 | 249 | 6/22/2023 |
| 6.0.0 | 282 | 5/4/2023 |
| 5.0.3 | 306 | 4/27/2023 |
| 5.0.2 | 331 | 4/11/2023 |
| 5.0.1 | 376 | 2/22/2023 |
| 5.0.0 | 502 | 11/10/2022 |
| 4.0.11 | 454 | 11/10/2022 |
| 4.0.10 | 446 | 11/10/2022 |
| 4.0.9 | 574 | 9/6/2022 |
| 4.0.8 | 626 | 7/25/2022 |
| 4.0.7 | 561 | 7/25/2022 |
| 4.0.6 | 564 | 7/25/2022 |
| 4.0.5 | 594 | 7/14/2022 |
| 4.0.4 | 251 | 7/14/2022 |
| 4.0.3 | 691 | 3/24/2022 |
| 4.0.2 | 325 | 12/16/2021 |
| 4.0.1 | 285 | 12/16/2021 |
| 4.0.0 | 1,029 | 11/29/2021 |
| 3.0.3 | 762 | 10/15/2020 |
| 3.0.2 | 636 | 9/30/2020 |
| 3.0.1 | 604 | 9/29/2020 |
| 3.0.0 | 654 | 9/16/2020 |
| 2.0.2 | 783 | 7/8/2020 |
| 2.0.1 | 761 | 12/25/2019 |
| 2.0.0 | 692 | 12/25/2019 |
| 1.0.6 | 722 | 12/5/2019 |
| 1.0.5 | 826 | 6/2/2019 |
| 1.0.4 | 927 | 11/30/2018 |
| 1.0.3 | 965 | 11/12/2018 |
| 1.0.2 | 951 | 11/12/2018 |
| 1.0.1 | 960 | 11/12/2018 |
| 1.0.0 | 951 | 11/12/2018 |
Upgraded to .net 10, please use older versions for .net 8 and .net 9