Evospike.AzureStorage
1.0.0
There is a newer version of this package available.
See the version list below for details.
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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.
-
net5.0
- Azure.Storage.Blobs (>= 12.9.1)
- Microsoft.AspNetCore.Http (>= 2.2.2)
- Microsoft.Extensions.Configuration (>= 5.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 5.0.0)
- Microsoft.Extensions.DependencyInjection (>= 5.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.