Evospike.AzureStorage 1.0.0

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

// Install Evospike.AzureStorage as a Cake Tool
#tool nuget:?package=Evospike.AzureStorage&version=1.0.0                

Evospike.AzureStorage

This package is designed to use azure blob storage in a very simple way.

Allows you to configure AzureStorage in a very simple way

appsettings.json configuration

The file path and other settings can be read from JSON configuration if desired.

In appsettings.json add a "AzureStorageSetting" properties:

{
   "AzureStorageSetting": {
    "StorageConnectionString": "AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;DefaultEndpointsProtocol=http;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;",
    "AccountUrl": "http://127.0.0.1:10000/devstoreaccount1"
  }
}

And then pass the configuration section to the next methods:

services.AddAzureStorageClient(Configuration);

Example of a controller using dependency injection services

public class ItemsController : ControllerBase
{
    private readonly IStorageService _storageService;

    public ItemsController(IStorageService storageService)
    {
        _storageService = storageService;
    }

    public async Task<IActionResult> UploadFile(IFormFile file)
    {
        var responseUrl = await _storageService.SaveBlobAsync("ContainerName", file);
        return Redirect(responseUrl);
    }
    
    public IActionResult ViewFile(string fileName)
    {
        var responseUrl = _storageService.GetProtectedUrl("ContainerName", fileName, DateTimeOffset.UtcNow.AddSeconds(10));
        return Redirect(responseUrl);
    }
    
    public async Task<IActionResult> DeleteFile(string fileName)
    {
        await _storageService.RemoveBlobAsync("ContainerName", fileName);
        return View();
    }
}
There are no supported framework assets in this 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
1.0.8 377 12/22/2022
1.0.7 260 12/22/2022
1.0.6 338 12/29/2021
1.0.5 272 12/29/2021
1.0.4 254 12/29/2021
1.0.3 262 12/29/2021
1.0.2 266 12/28/2021
1.0.1 260 12/23/2021
1.0.0 312 8/25/2021