AmperLabs.Azure.Storage.Blobs
0.1.6
dotnet add package AmperLabs.Azure.Storage.Blobs --version 0.1.6
NuGet\Install-Package AmperLabs.Azure.Storage.Blobs -Version 0.1.6
<PackageReference Include="AmperLabs.Azure.Storage.Blobs" Version="0.1.6" />
paket add AmperLabs.Azure.Storage.Blobs --version 0.1.6
#r "nuget: AmperLabs.Azure.Storage.Blobs, 0.1.6"
// Install AmperLabs.Azure.Storage.Blobs as a Cake Addin #addin nuget:?package=AmperLabs.Azure.Storage.Blobs&version=0.1.6 // Install AmperLabs.Azure.Storage.Blobs as a Cake Tool #tool nuget:?package=AmperLabs.Azure.Storage.Blobs&version=0.1.6
AmperLabs.Azure.Storage.Blobs
This project provides extension methods for the BlobContainerClass in the Microsoft Azure SDK for .NET (v12).
Table of Contents
General Information
This project was created to make life easier when dealing with uploading/downloading/deleting file structures in an Azure Storage Blob Container. Especially uploading/downloading a complete directory structures to/from a container or virtual directory (aka prefix) in a container involves too much boiler plate code.
Technologies Used
- netstandard2.0
- Azure SDK for .NET (v12)
Features
- UploadDirectoryAsync
- DownloadBlobsToAsync
- DeleteBlobsAsync
Setup
Install from nuget.org:
dotnet add package AmperLabs.Azure.Storage.Blobs
Usage
Assume the following file structure under a local directory .\Temp\StorageTest
:
.\Temp\StorageTest
│ File1.txt
│ File2.txt
│ File3.txt
│
├───AnotherFolder
│ AnotherFile.txt
│
└───Folder
│ FileA.txt
│ FileB.txt
│
└───SubFolder
FileX.txt
then
using Azure.Storage.Blobs;
using AmperLabs.Azure.Storage.Blobs;
string _connectionString = "<storageConnectionString>";
string _containerName = "<containerName>";
# Create a new BlobContainerClient
var _containerClient = new BlobContainerClient(_connectionString, _containerName);
# Create the container if neccessary
_containerClient.CreateIfNotExists();
# Upload contents from a local directory directly to the container
await _containerClient.UploadDirectoryAsync(@".\Temp\StorageTest");
# This will upload the contents to a virtual folder named 'my' in the container
await _containerClient.UploadDirectoryAsync(@"D:\Temp\StorageTest", "my");
# Download the Blobs from the container to a local directory
# Local directories get created as needed
await _containerClient.DownloadBlobsToAsync(@".\Temp\StorageTestDownload");
# Download the Blobs from a virtual directory named 'Folder' in the container to a local directory
# Local directories get created as needed
await _containerClient.DownloadBlobsToAsync(@".\Temp\StorageTestDownload", "Folder");
# Delete all Blobs in the container
await _containerClient.DeleteBlobsAsync();
# Delete all Blobs in the virtual directory named 'Folder' the container
await _containerClient.DeleteBlobsAsync();
Project Status
Project is: in progress
Gitpod
License
This project is open source and available under the
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- azure.storage.blobs (>= 12.11.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.