AmperLabs.Azure.Storage.Blobs 0.1.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package AmperLabs.Azure.Storage.Blobs --version 0.1.3                
NuGet\Install-Package AmperLabs.Azure.Storage.Blobs -Version 0.1.3                
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="AmperLabs.Azure.Storage.Blobs" Version="0.1.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AmperLabs.Azure.Storage.Blobs --version 0.1.3                
#r "nuget: AmperLabs.Azure.Storage.Blobs, 0.1.3"                
#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.
// Install AmperLabs.Azure.Storage.Blobs as a Cake Addin
#addin nuget:?package=AmperLabs.Azure.Storage.Blobs&version=0.1.3

// Install AmperLabs.Azure.Storage.Blobs as a Cake Tool
#tool nuget:?package=AmperLabs.Azure.Storage.Blobs&version=0.1.3                

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

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

License

This project is open source and available under the

License: MIT

Product 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. 
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.

Version Downloads Last updated
0.1.6 436 5/22/2022
0.1.5 430 5/22/2022
0.1.3 417 5/5/2022
0.1.1 397 5/5/2022