Copied to clipboard

Flag this post as spam?

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


  • Ault Nathanielsz 87 posts 407 karma points c-trib
    May 12, 2020 @ 12:46
    Ault Nathanielsz
    0

    Azure Blob storage and Azure CDN

    I have set up Umbraco to serve media (and cached media e.g. image crops) from Azure Blob storage.

    Is this enough? Or should I also use Azure CDN?

    I can see how to set add CDN to my Azure storage, but I assume that some settings in Umbraco should also be configured. Can anyone share their insights?

  • Ault Nathanielsz 87 posts 407 karma points c-trib
    May 12, 2020 @ 16:02
    Ault Nathanielsz
    0

    Here is my summary from a discussion on this topic on Slack:

    Unless you are serving numerous (or very large) files, the CDN is not really worth doing.

    Just by using blob storage for media and cache (e.g. crops) you have managed to centralise the media (i.e. it is no longer held locally).

    The webapp will be a constraining factor (as any request for /media/ is first handled there).

    One argument for using a CDN is that it is more likely to support HTTP/2 - but that is well outside my current use case.

  • Per Bolmstedt 84 posts 380 karma points
    Oct 06, 2020 @ 19:02
    Per Bolmstedt
    0

    The webapp will be a constraining factor (as any request for /media/ is first handled there).

    Isn't it possible to just have the front-end emit media links to https://site.blob.azure.com/media/ instead of https://site/media/ to mitigate this?

    That's how a CDN endpoint against the BLOb Storage Container would have to work anyway, with links to https://cdn.site.azure.com/media/, right?

  • Ault Nathanielsz 87 posts 407 karma points c-trib
    Oct 07, 2020 @ 16:46
    Ault Nathanielsz
    0

    That sounds reasonable... but you probably want it to run through the webapp to generate any missing (previously unrequested) crops.

    (I think that's how it works... I'm still a relative noob in the Umbracoverse.)

  • Bobi 352 posts 956 karma points
    Apr 27, 2022 @ 03:40
    Bobi
    0

    Could someone please share how to link blob storage to an Azure CDN and the changes needed regarding the CDN, if any, in umbraco?

  • Per Bolmstedt 84 posts 380 karma points
    Apr 27, 2022 @ 12:57
    Per Bolmstedt
    1
      "Umbraco": {
    
        "Storage": {
          "AzureBlob": {
            "Media": {
              "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=a;AccountKey=k;EndpointSuffix=core.windows.net",
              "ContainerName": "c",
              "Cdn": {
                "Url": "https://u.azureedge.net/"
    

    and

                // Add the Azure Blob Storage file system, ImageSharp image provider/cache and middleware for Media:
                u.AddAzureBlobMediaFileSystem()
                // Optionally add the CDN media URL provider:
                .AddCdnMediaUrlProvider(options =>
                {
                    var settings = _config.GetSection("Umbraco:Storage:AzureBlob:Media:Cdn");
                    options.Url = new Uri(settings.GetValue<string>("Url"));
                });
    
  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Apr 27, 2022 @ 13:22
  • Bobi 352 posts 956 karma points
    Apr 27, 2022 @ 18:06
    Bobi
    0

    I am still a bit lost in regard to the configuration. I followed the umbraco documentation (https://our.umbraco.com/Documentation/Extending/FileSystemProviders/Azure-Blob-Storage/index-v8) and the site works, but I am not 100% certain it is configured properly.

    @Per Bolmstedt, where does that code go?

    @Jeavon Leopold, thank you. I looked at this. I took the following steps:

    1. I created a storage account in azure (was not too sure about security settings under networking tab or configuration tab, i.e. allow blob public access)

    2. Under the Azure CDN tab in the storage account I created an endpoint (under the endpoint tab) with origin pointing to the blob storage.

    3. Under the caching tab in the cdn, I choose cache every unique url.

    4. Followed the documentation from the link above, and moved all files to media folder in storage container.

    5. Site works, but I am unsure if any further settings are needed. I do not see the cache folder in the storage and the back office log shows a lot of image processing errors as shown https://our.umbraco.com/forum/using-umbraco-and-getting-started/104074-image-processor-error.

    Any ideas why the error or is the configuration incorrect?

  • Per Bolmstedt 84 posts 380 karma points
    Apr 27, 2022 @ 21:07
    Per Bolmstedt
    1

    https://our.umbraco.com/forum/using-umbraco-and-getting-started/102205-azure-blob-storage-and-azure-cdn#comment-337976 and https://our.umbraco.com/Documentation/Extending/FileSystemProviders/Azure-Blob-Storage/shows where the code goes. :)

    But I think you have already put the code in the correct place, if your site works & media is in Azure.

    Your "I created an endpoint (under the endpoint tab) with origin pointing to the blob storage" remark sounds like it could be incompatible with croppings. We always set our CDN endpoints to pull media from Umbraco,

  • Bobi 352 posts 956 karma points
    Apr 27, 2022 @ 21:28
    Bobi
    0

    Thanks. How do you set the CDN endpoints to pull media from umbraco (the steps to create the cdn endpoint when storage container for media is already created)? I think you're right. I just tested the live image cropper to reposition the focal point and it is not moving images. I imagine this is related to the imageprocesser errors in the logs (hundreds) (could be related).

  • Per Bolmstedt 84 posts 380 karma points
    Apr 28, 2022 @ 06:19
    Per Bolmstedt
    0

    The focal-point feature is not automatic IIRC, I think you have to do something in the views to enable it. This is probably unrelated to Azure Storage.

    The CDN endpoint has https://umbraco-site/media as its source/upstream.

    Any emitted URL will be on the form https://cdn/umbraco-media-id/media.jpeg?crop=x&focus=y&format=z and the CDN endpoint will then fetch the media from Umbraco "as usual".

    Umbraco doesn't know it is the CDN endpoint requesting the cropped/focused/etc. media.

    From a base installation, I think you only need to add the storage/CDN configuration and the Startup code.

    I'd start with verifying that the configuration is correct; IIRC the Azure Storage feature in Umbraco is disabled if it isn't.

  • Bobi 352 posts 956 karma points
    Apr 28, 2022 @ 16:34
    Bobi
    0

    I followed the blob storage guide from Umbraco here. I am not using azure blob cache, perhaps that is the issue? I set up a blob storage in azure, then a container called media. everything is storing correctly, but I am getting image processor errors in the logs. Only the localhost, changing the focal point of an image used to work. Now it does not. I imagine it is related somehow.

    I want to also create a CDN endpoint for faster response, but it sounds like it is not required.

Please Sign in or register to post replies

Write your reply to:

Draft