项目作者: ssinno28

项目描述 :
A service that provides all necessary functionality to maintain your azure storage account as well as helps to create hierarchical paths for organizational purposes.
高级语言: C#
项目地址: git://github.com/ssinno28/FileManager.Azure.git
创建时间: 2018-08-13T19:59:35Z
项目社区:https://github.com/ssinno28/FileManager.Azure

开源协议:MIT License

下载


FileManager.Azure

CI

Install-Package FileManager.Azure

A service that provides all necessary functionality to maintain your azure storage account as well as helps to create hierarchical paths for organizational purposes. You will need to add the file manager service via DI:

  1. services.AddFileManager(Configuration);

There are a few claims (that currently have defaults), that will be useful when trying to restrict access to certain paths:

  • RootFolder - default is “/“
  • BlobContainerSizeLimit - default is 500TB^2

The FileManager gets injected as a Func, since every instance could be working with a separate container:

  1. private readonly Func<string, IFileManager> _fileManagerFactory:
  2. public TestClass(Func<string, IFileManager> fileManagerFactory) {
  3. _fileManagerFactory = fileManagerFactory;
  4. var fileManager = _fileManagerFactory("myContainerName");
  5. }

Make sure to add two settings to the appsettings.json file. First and most importantly is the StorageConnStr property and the other is a boolean property called TakeSnapshots. If TakeSnapshots is set to true then it will take a snapshot of a file whenever it is either replaced or deleted.

For more information check out this blog article: https://www.sammisinno.com/azure/simplifing-access-to-azure-blob-storage

In order to run the tests you have to install the azurite npm package and run this command line

azurite-blob -s --blobPort 7777