Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The azure blob storage can't use local storage account #491

Closed
stefanolsenn opened this issue Jan 22, 2019 · 4 comments
Closed

The azure blob storage can't use local storage account #491

stefanolsenn opened this issue Jan 22, 2019 · 4 comments
Assignees
Milestone

Comments

@stefanolsenn
Copy link

stefanolsenn commented Jan 22, 2019

Hi.

So an easy fix but quite breaking for existing projects, is to inject a connection-string or a CloudStorageAccount instead of StorageCredentials in BlobStorage.cs.

Any possibility for adding this in future releases?

@tidyui
Copy link
Member

tidyui commented Jan 23, 2019

Hi there! I don't see any problem adding a second constructor & extension method that creates the storage with a connection string & optional container name, like so:

public BlobStorage(string connectionString, string containerName = "uploads")
{
    ...
}

In fact, to get this going you should be able to just extend the BlobStorage class in your own project to test it:

using Piranha.Azure;

public CustomBlobStorage : BlobStorage
{
    public CustomBlobStorage(string connectionString, string containerName = "uploads")
    {
        ...
    }
}

And register it in your Startup:

services.AddSingleton<IStorage>(new CustomBlobStorage(...));

Best regards

@tidyui tidyui added this to the Version 6.0 milestone Jan 23, 2019
@stefanolsenn
Copy link
Author

Very cool, thanks. I already did test with a connection string, and can confirm it solves the problem.

@tidyui tidyui self-assigned this Jan 25, 2019
@tidyui tidyui closed this as completed in 1222c1b Jan 26, 2019
@tidyui
Copy link
Member

tidyui commented Feb 16, 2019

Hi there! Yes we could push a new release. I’ll let you know when it’s available!

@tidyui tidyui modified the milestones: Version 6.0, Version 5.3.1 Feb 16, 2019
@tidyui
Copy link
Member

tidyui commented Feb 16, 2019

Version 5.3.1 of Piranha.Azure.BlobStorage is now available on NuGet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants