Api for communicating with azure blob storage
Table of Contents
This is a api that uploads files to azure blob storage. have ability to create, delete and retrieve blobs and containers. it provides it's own sdk.
-
Install the latest .NET 5 SDK
-
Install Git
-
Clone the repo
git clone https://github.com/your_username_/Project-Name.git
-
Create a folder for your solution and cd into it
-
Navigate to
src/API
-
you will need to update appsettings.json and appsettings.Development.json and provide your azure blob storage connection string:
"ConnectionStrings": {
"AzureBlobStorage": ""
},
- run
dotnet run
Project provides it's own sdk, which you can publish and use in several projects, without writing intergration code in every project.
inject blob client into dependency injection container pass published api url and service lifetime(default if Scoped)
services.AddBlobClient(x=>x.Url = "");
use IBlobClient and IContainerClient interfaces
private readonly IContainerClient _containerClient;
private readonly IBlobClient _blobClient;
public ExampleService(IContainerClient containerClient,IBlobClient blobClient)
{
_containerClient = containerClient;
_blobClient = blobClient;
}
public async Task Example(CancellationToken cancellationToken)
{
var containerList = await _containerClient.ListAsync(cancellationToken);
var blobList = await _blobClient.ListAsync("containername",cancellationToken);
}
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed with the MIT license.