Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paul Griffiths 370 posts 1021 karma points
    Oct 28, 2022 @ 15:36
    Paul Griffiths
    0

    Using azure blob storage for Umbraco Media | DataAnnotation validation failed for 'AzureBlobFileSystemOptions'

    Hello,

    New to Umbraco 10 and .NET core so this might be really simple for most.

    I've created a storage account in Azure and a container called media. I have followed the steps in https://our.umbraco.com/documentation/Extending/FileSystemProviders/Azure-Blob-Storage/

    Here is my config in appsettings.json

      "Umbraco": {
    "CMS": {
      "Global": {
        "Id": "MYID",
        "SanitizeTinyMce": true
      },
      "Content": {
        "AllowEditInvariantFromNonDefault": true,
        "ContentVersionCleanupPolicy": {
          "EnableCleanup": true
        }
      },
      "Storage": {
        "AzureBlob": {
          "Media": {
            "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=<STORAGENAME>;AccountKey=<MYKEY>;EndpointSuffix=core.windows.net",
            "ContainerName": "<CONTAINERNAME>"
          }
        }
      },
      "CMS": {
        "Hosting": {
          "Debug": false
        }
      }
    }
    

    }

    In the startup.cs I have added

    enter image description here

    The output is

    enter image description here

    Where do I need to specify the connection string and container name please?

    https://www.davidbuckell.com/blogs/development/umbraco/moving-umbraco-media-to-azure-blob-storage/ suggests I need to add 'UseAzureBlobMediaFileSystem' method in the configure but that's not found.

    I am using the latest Umbraco version on .net 6, locally!

    Can anyone point me in the right direction please?

    Thanks Paul

  • Andy Boot 50 posts 192 karma points MVP
    Oct 29, 2022 @ 09:25
    Andy Boot
    100

    Hi Paul,

    It appears you've got the Storage key and its values set as Umbraco:CMS:Storage, not Umbraco:Storage. Also as a sidenote it also appears you've got an extra CMS key in the chain with Umbraco:CMS:CMS:Hosting.

    Here's the corrected JSON based on your posted example:

    {
       "Umbraco":{
          "CMS":{
             "Global":{
                "Id":"MYID",
                "SanitizeTinyMce":true
             },
             "Content":{
                "AllowEditInvariantFromNonDefault":true,
                "ContentVersionCleanupPolicy":{
                   "EnableCleanup":true
                }
             },
             "Hosting":{
                "Debug":false
             }
          },
          "Storage":{
             "AzureBlob":{
                "Media":{
                   "ConnectionString":"DefaultEndpointsProtocol=https;AccountName=<STORAGENAME>;AccountKey=<MYKEY>;EndpointSuffix=core.windows.net",
                   "ContainerName":"<CONTAINERNAME>"
                }
             }
          }
       }
    }
    

    Hopefully that resolves your issue. I've recently got this working with the latest version of Umbraco too, so all being well that'll clear the missing ContaininerName error you're getting.

    All the best,

    Andy.

  • Paul Griffiths 370 posts 1021 karma points
    Oct 29, 2022 @ 09:59
    Paul Griffiths
    1

    Hello Andy,

    Thanks so much for taking the time to respond, your solution has fixed my issue :). Now I can continue with getting v10 up and running on Azure.

    enter image description here

    I knew it would be a config issue but I'm still getting to grips with the JSON app settings and what needs to go where.

    Thank you again!

    For anyone interested I'm following Paul Seals excellent v10 umbraco series https://www.youtube.com/watch?v=qEZtjxDEK8g&t and was using Simone Chiaretta skrift article for the azure setup https://skrift.io/issues/umbraco-devops-part-1-how-to-configure-umbraco-to-run-on-azure/

  • Andy Boot 50 posts 192 karma points MVP
    Oct 29, 2022 @ 10:29
    Andy Boot
    0

    Hey Paul, glad that resolved your issue!

    Just FYI, after briefly looking at that Skrift article, you may find that some of it is applicable to Umbraco v8 only and not applicable to v9+.

Please Sign in or register to post replies

Write your reply to:

Draft