Azure blob files not showing in Kentico media library on Azure App

Tomasz Czado asked on April 7, 2021 10:41

I have latest Kentico application + .NET Core MVC. Both solutions are setup to use Azure Blob Storage as media library. That is the code both uses:

protected override void OnInit()
{
    base.OnInit();

    // Creates a new StorageProvider instance for Azure
    var mediaProvider = StorageProvider.CreateAzureStorageProvider();

    // Specifies the target container
    mediaProvider.CustomRootPath = "media";

    //// Makes the container publicly accessible
    mediaProvider.PublicExternalFolderObject = true;

    // Maps a directory to the provider
    StorageHelper.MapStoragePath("~/Test/media/", mediaProvider);
}

For some reason it works on my local machine but when I released it to Azure, then when I open media library I can only see "FolderTree.FailedLoad: Could not find file 'D:\home\site\wwwroot\Test'." in the column where I should see folders tree.

I reviewd documentation and I can't see what's wrong so far.

Any idea?

Recent Answers


Dmitry Bastron answered on April 7, 2021 11:03

Hi Tomasz,

Check out Settings Application, Settings > Content > Media > Media libraries folder. I guess on Azure instance it contains something like "D:\home\site\wwwroot\Test". Remove it and keep it blank, in this case, it will be using the default media path instead.

0 votesVote for this answer Mark as a Correct answer

Tomasz Czado answered on April 7, 2021 11:16

The setting is already empty - On my local machine the same as on Azure App I have used the same db instance.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on April 7, 2021 18:54

What are the blob settings? Is the SSL/HTTPS enforced? What is set in the config files for both apps? (just clear out the secrets, do not post them here)

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.