Piranha.core: The azure blob storage can't use local storage account

Created on 22 Jan 2019  路  4Comments  路  Source: PiranhaCMS/piranha.core

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?

core enhancement

Most helpful comment

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

All 4 comments

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

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

Hi there! Yes we could push a new release. I鈥檒l let you know when it鈥檚 available!

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

codesoroush picture codesoroush  路  6Comments

aneff-official picture aneff-official  路  3Comments

jcphlux picture jcphlux  路  4Comments

tidyui picture tidyui  路  6Comments

tidyui picture tidyui  路  6Comments