An open API service indexing awesome lists of open source software.

https://github.com/iowacomputergurus/aspnetcore.utilities.cloudstorage

A collection of cloud storage utilities to assist with the management of files for cloud upload.
https://github.com/iowacomputergurus/aspnetcore.utilities.cloudstorage

azure hacktoberfest netcore netcore-cloudstorage

Last synced: 6 months ago
JSON representation

A collection of cloud storage utilities to assist with the management of files for cloud upload.

Awesome Lists containing this project

README

          

# aspnetcore.utilities.cloudstorage ![](https://img.shields.io/github/license/iowacomputergurus/aspnetcore.utilities.cloudstorage.svg)

![Build Status](https://github.com/IowaComputerGurus/aspnetcore.utilities.cloudstorage/actions/workflows/ci-build.yml/badge.svg)

This project provides a number of helpful wrappers around the Microsoft Azure Storage API's to allow for more rapid development. Including the ability to do single-line upload of files from an IFormFile into Azure Blob Storage.

## NuGet Status (ICG.AspNetCore.Utilities.CloudStorage)

![](https://img.shields.io/nuget/v/icg.aspnetcore.utilities.cloudstorage.svg) ![](https://img.shields.io/nuget/dt/icg.aspnetcore.utilities.cloudstorage.svg)

## SonarCloud Analysis

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=IowaComputerGurus_aspnetcore.utilities.cloudstorage&metric=alert_status)](https://sonarcloud.io/dashboard?id=IowaComputerGurus_aspnetcore.utilities.cloudstorage)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=IowaComputerGurus_aspnetcore.utilities.cloudstorage&metric=coverage)](https://sonarcloud.io/dashboard?id=IowaComputerGurus_aspnetcore.utilities.cloudstorage)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=IowaComputerGurus_aspnetcore.utilities.cloudstorage&metric=security_rating)](https://sonarcloud.io/dashboard?id=IowaComputerGurus_aspnetcore.utilities.cloudstorage)
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=IowaComputerGurus_aspnetcore.utilities.cloudstorage&metric=sqale_index)](https://sonarcloud.io/dashboard?id=IowaComputerGurus_aspnetcore.utilities.cloudstorage)

## Using ICG.AspNetCore.Utilities.CloudStorage

### Installation

Install from NuGet

``` powershell
Install-Package ICG.AspNetCore.Utilities.CloudStorage
```
### Register Dependencies

Inside of of your project's Startus.cs within the RegisterServices method add this line of code.

``` c#
services.UseIcgNetCoreUtilities(Configuration);
services.UseIcgAspNetCoreUtilitiesCloudStorage();
```

## Configure

Lastly, before using you will need to configure your storage options. An example configuation is below.

``` json
"AzureCloudStorageOptions": {
"StorageConnectionString": "",
"RootClientPath": "",
"DefaultSASTokenDurationMinutes": 60
}
```

> [!NOTE]
> Root client path could be https://youraccount.blob.core.windows.net or if you have configured a CDN your CDN path. This is what will be used to provide the return path of uploaded objects

> [!WARNING]
> Be sure to consider security of these credentials, this library fully supports `IOptions` so you can utilize environment variables, the `appsettings.json` file or any other mechanism that injects values to Configuration

### Included Features

| Object | Purpose |
| ---- | --- |
| IAzureCloudStorageProvider | Provides the tools necessary to upload objects to Azure |
| IMimeTypeMapper | An implementation of a mime-type mapper, copied from similar code in .NET Core, but moved internal to limit dependencies

## Included Dependencies

Usage of this package will automatically add the following additional NuGet packages

* ICG.AspNetCore.Utilities - Used to provide the IUrlSlugProvider for one overload in the ICloudStorageProvider implementation
* Azure.Storage.Blobs - Used to actually communicate with Azure.

Detailed information can be found in the XML Comment documentation for the objects, we are working to add to this document as well.

## Version 5.x Breaking Change

To adhere to Microsoft API standards the application has been updated to require the usage of a Storage Connection String, rather than a Account Name and Access Key.