{"id":37053952,"url":"https://github.com/microcompiler/backblaze","last_synced_at":"2026-02-09T00:11:01.222Z","repository":{"id":45285755,"uuid":"199963186","full_name":"microcompiler/backblaze","owner":"microcompiler","description":"Backblaze.Agent is a high-performance .NET Core implementation of the Backblaze B2 Cloud Storage API.","archived":false,"fork":false,"pushed_at":"2025-06-07T23:16:48.000Z","size":598,"stargazers_count":48,"open_issues_count":18,"forks_count":16,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T13:28:16.481Z","etag":null,"topics":["api","aws","azure","b2","backblaze","backblaze-b2","buckets","cloud-storage","csharp","net","pod","s3","sdk","storage"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microcompiler.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-08-01T02:40:38.000Z","updated_at":"2025-11-07T15:20:07.000Z","dependencies_parsed_at":"2024-06-21T19:05:23.237Z","dependency_job_id":"df65c9bd-5c88-4bd9-b3d4-f66530aed769","html_url":"https://github.com/microcompiler/backblaze","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/microcompiler/backblaze","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microcompiler%2Fbackblaze","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microcompiler%2Fbackblaze/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microcompiler%2Fbackblaze/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microcompiler%2Fbackblaze/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microcompiler","download_url":"https://codeload.github.com/microcompiler/backblaze/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microcompiler%2Fbackblaze/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","aws","azure","b2","backblaze","backblaze-b2","buckets","cloud-storage","csharp","net","pod","s3","sdk","storage"],"created_at":"2026-01-14T06:05:11.944Z","updated_at":"2026-01-14T06:05:12.552Z","avatar_url":"https://github.com/microcompiler.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backblaze Agent for .NET Core\n\n[![NuGet Version](https://img.shields.io/nuget/vpre/Backblaze.Agent.svg?style=flat-square)](https://www.nuget.org/packages/Backblaze.Agent)\n[![NuGet Downloads](https://img.shields.io/nuget/dt/Backblaze.Agent.svg?style=flat-square)](https://www.nuget.org/packages/Backblaze.Agent)\n\nThe Backblaze Agent (client) for .NET Core is an implementation of the [Backblaze B2 Cloud Storage API](https://www.backblaze.com/b2/cloud-storage.html). Backblaze B2 Cloud Storage provides the cheapest cloud storage available on the internet. Backblaze B2 Cloud Storage is ¼ of the price of other storage providers. Give it a try as the first 10 GB of storage is free.\n\n## Features\n\n - Full support for Backblaze B2 Cloud Storage API v2 including files, accounts, keys and buckets.\n - Built targeting .NET Standard 2.0 which means Backblaze Agent will work on Windows, Mac and Linux systems.\n - Seamlessly intergrates with .NET Core Dependency Injection and HttpClientFactory to implement resilient requests.\n - Simple in-memory response cache using MemoryCache.\n - Large file support with low memory allocation and IProgress status.\n - Native support of task based programming model (async/await).\n\nFor feature requests and bug reports, please [open an issue on GitHub](https://github.com/microcompiler/backblaze/issues/new).\n\n## Installation via .NET CLI\n\nTo install Backblaze.Agent run the following command:\n\n```bash\n\u003e dotnet add package Backblaze.Agent\n```\n\n## Getting Started\n\n*Work in Progress!* Whilst we encourage users to play with the samples and test programs, this project has not yet reached a stable state.\n\nYou will need an **key_id** and an **application_key** to configure Backblaze Agent. You can obtain these from the [Backblaze B2 Cloud Storage](https://www.backblaze.com/b2/cloud-storage.html) portal. See the [Sample Project](https://github.com/microcompiler/backblaze/tree/master/samples ) for an example of how to use this packages.\n\n### Adding Backblaze Agent to Services\n\n```CSharp\npublic void ConfigureServices(IServiceCollection services)\n{\n    services.AddBackblazeAgent(options =\u003e\n    {\n    options.KeyId = \"[key_id]\";\n    options.ApplicationKey = \"[application_key]\";\n    });\n}\n```\n\nTo get a list of backblaze buckets simply inject `IStorageClient` into your class and call the async client.  \n\n```csharp\npublic class IndexModel : PageModel\n{\n  private readonly IStorageClient _storage;\n\n  public IndexModel(IStorageClient storage)\n  {\n      _storage = storage;\n  }\n\n  [BindProperty]\n  public IEnumerable\u003cBucketItem\u003e Buckets { get; private set; }\n\n  public async Task\u003cIActionResult\u003e OnGetAsync()\n  {\n    Buckets = await _storage.Buckets.GetAsync();\n\n    if (Buckets == null)\n    {\n      return NotFound();\n    }\n\n    return Page();\n  }\n}\n```\n\n### Initializing Backblaze Client without Dependency Injection\n\nInstall the following packages:\n\n```bash\n\u003e dotnet add package Backblaze.Client\n\u003e dotnet add package Microsoft.Extensions.Caching.Memory\n\u003e dotnet add package Microsoft.Extensions.Logging.Debug\n```\n\nSample Code:\n\n```csharp\n\nclass Program\n{\n  private static IStorageClient Client;\n\n  static async Task Main(string[] args)\n  {\n    try\n    {\n      var options = new ClientOptions();\n\n      var loggerFactory = LoggerFactory.Create(builder =\u003e\n      {\n        builder\n          .AddFilter(\"Bytewizer.Backblaze\", LogLevel.Trace)\n          .AddDebug();\n      });\n\n      var cache = new MemoryCache(new MemoryCacheOptions());\n\n      Client = new BackblazeClient(options, loggerFactory, cache);  \n      await Client.ConnectAsync(\"[key_id]\", \"[application_key]\");\n\n      var buckets = await Client.Buckets.GetAsync();\n\n      foreach (var bucket in buckets)\n        Console.WriteLine($\"Bucket Name: {bucket.BucketName} - Type: {bucket.BucketType}\");   \n    }\n    catch (Exception ex)\n    {\n      Console.Error.WriteLine(ex.Message);\n    }\n  }\n}\n```\n\n### Initializing Backblaze Client without Dependency Injection, Logging or Caching\n\nInstall the following package:\n\n```bash\n\u003e dotnet add package Backblaze.Client\n```\n\nSample Code:\n\n```csharp\nclass Program\n{\n  private static IStorageClient Client;\n\n  static async Task Main(string[] args)\n  {\n    try\n    {\n      Client = new BackblazeClient();\n      Client.Connect(\"[key_id]\", \"[application_key]\");\n\n      var buckets = await Client.Buckets.GetAsync();\n\n      foreach (var bucket in buckets)\n      {\n          Console.WriteLine($\"Bucket Name: {bucket.BucketName} - Type: {bucket.BucketType}\");\n      }\n    }\n    catch (Exception ex)\n    {\n      Console.Error.WriteLine(ex.Message);\n    }\n  }\n}\n```\n\n## Basic Usage\n\nUpload File Stream\n\n```csharp\nforeach (var filePath in Directory.GetFiles(@\"c:\\my\\directory\"))\n{\n  using (var stream = File.OpenRead(filePath))\n  {\n    var results = await Client.UploadAsync(\"[BucketId]\", new FileInfo(filePath).Name, stream);\n  }\n}\n```\n\nDownload File Stream\n\n```csharp\nvar files = new string[] { @\"c:\\my\\directory\\file1.txt\", \"file2.bat\" };\n\nforeach (var fileName in files)\n{\n  using (var stream = File.Create(fileName))\n  {\n      var results = await Client.DownloadAsync(\"[BucketName]\", fileName, stream);\n  }\n}\n```\n\n## Microsoft Logging Integration\n\nInstall the Microsoft.Extensions.Logging packages:\n\n```bash\n\u003e dotnet add package Microsoft.Extensions.Logging.Debug\n```\n\nTracing to the Debug window can be enabled with the following code:\n\n```csharp\nservices.AddLogging(builder =\u003e\n{\n    builder.AddDebug();\n    builder.AddFilter(\"Bytewizer.Backblaze\", LogLevel.Trace);\n});\n```\n\n## Agent Options\n\n```csharp\nservices.AddBackblazeAgent(options =\u003e\n{\n  options.KeyId = \"[key_id]\";\n  options.ApplicationKey = \"[application_key]\";\n});\n```\n\nThe following table describes the [Agent Options](https://github.com/microcompiler/backblaze/blob/master/src/Client/Client/IClientOptions.cs) available:\n\n| Option Name | Default | Description |\n| ----------- | ------- | ----------- |\n| KeyId  | --- | **Required** - The key identifier used to authenticate. |\n| ApplicationKey | --- | **Required** - The secret part of the key used to authenticate. |\n| HandlerLifetime | 600 | The time in seconds that the message handler instance can be reused. |\n| Timeout | 600 | The time in seconds to wait before the client request times out. |\n| RetryCount | 5 | The number of times the client will retry failed requests before timing out. |\n| RequestMaxParallel | 10 | The maximum number of parallel request connections established. |\n| DownloadMaxParallel | 5 | The maximum number of parallel download connections established. |\n| DownloadCutoffSize | 100MB | Download cutoff size for switching to chunked parts in bytes. |\n| DownloadPartSize | 100MB | Download part size of chunked parts in bytes. |\n| UploadMaxParallel | 3 | The maximum number of parallel upload connections established. |\n| UploadCutoffSize | 100MB | Upload cutoff size for switching to chunked parts in bytes. |\n| UploadPartSize | 100MB | Upload part size of chunked parts in bytes. |\n| AutoSetPartSize  | false | Use the recommended part size returned by the Backblaze service. |\n| ChecksumDisabled  | false | This is for testing use only and not recomended for production environments. |\n| TestMode  | --- | This is for testing use only and not recomended for production environments. |\n\n### Test Mode Options\n\n```csharp\nservices.AddBackblazeAgent(options =\u003e\n{\n  // This is for testing use only and not recomended for production environments.\n  options.TestMode = \"fail_some_uploads\";  \n});\n```\n\nThe following test mode options are available to verify that your code correctly handles error conditions.\n\n| Option String | Description |\n| ------------ | -------------------------------------------------------------------- |\n| fail_some_uploads| Random uploads fail or become rejected by the service. |\n| expire_some_account_authorization_tokens | Random account authorization tokens expire. |\n| force_cap_exceeded |Cap exceeded conditions are forced. |\n\n## Integration Tests\n\nYou will need an **key_id** and an **application_key** to configure Backblaze Test Agent [settings.json](https://github.com/microcompiler/backblaze/blob/master/test/Integration/settings.json) file.\n\n## Disclaimer\n\nAll source, documentation, instructions and products of this project are provided as-is without warranty. No liability is accepted for any damages, data loss or costs incurred by its use.\n\n## Branches\n\n**master** - This is the branch containing the latest release - no contributions should be made directly to this branch.\n\n**develop** - This is the development branch to which contributions should be proposed by contributors as pull requests. This development branch will periodically be merged to the master branch, and be released to [NuGet Gallery](https://www.nuget.org).\n\n## Contributions\n\nContributions to this project are always welcome. Please consider forking this project on GitHub and sending a pull request to get your improvements added to the original project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrocompiler%2Fbackblaze","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrocompiler%2Fbackblaze","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrocompiler%2Fbackblaze/lists"}