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.
- Host: GitHub
- URL: https://github.com/iowacomputergurus/aspnetcore.utilities.cloudstorage
- Owner: IowaComputerGurus
- License: mit
- Created: 2019-01-23T03:11:49.000Z (almost 7 years ago)
- Default Branch: develop
- Last Pushed: 2024-11-25T10:18:31.000Z (about 1 year ago)
- Last Synced: 2024-11-30T15:16:50.835Z (about 1 year ago)
- Topics: azure, hacktoberfest, netcore, netcore-cloudstorage
- Language: C#
- Homepage:
- Size: 186 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# aspnetcore.utilities.cloudstorage 

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)
 
## SonarCloud Analysis
[](https://sonarcloud.io/dashboard?id=IowaComputerGurus_aspnetcore.utilities.cloudstorage)
[](https://sonarcloud.io/dashboard?id=IowaComputerGurus_aspnetcore.utilities.cloudstorage)
[](https://sonarcloud.io/dashboard?id=IowaComputerGurus_aspnetcore.utilities.cloudstorage)
[](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.