https://discord.umbraco.com logo
#help-with-umbraco
Azure blob storage CDN
# help-with-umbraco
c

crlogan

09/29/2023, 4:46 PM
Hello! I am hitting one of those "I haven't done this in .NET core Umbraco yet" scenarios. This time it's trying to get blob storage media served through CDN. I am in a v10 (as it's LTS) site. My media is being stored in the blob with the use of the Umbraco.StorageProviders.AzureBlob package and working all good. Now I want the image urls to be via CDN rather then going through site domain. The docs aren't totally clear on how to do this with CDN and Azure blob storage as the github page https://github.com/umbraco/Umbraco.StorageProviders/blob/support/10.0.x/README.md#umbracostorageprovidersazureblob shows the appsettings for it on non azure example and the v10 docs don't seem to mention it: https://docs.umbraco.com/umbraco-cms/v/10.latest-lts/extending/filesystemproviders/azure-blob-storage. I tried adding this per the non azure example but it doesn't seem to be transferrable to my scenario. Cdn": { "Url": "xyz.azureedge.net", "RemoveMediaFromPath": true } Any advice would be super appreciated.
m

mistyn8

09/30/2023, 7:07 PM
Might this help? https://github.com/umbraco/Umbraco.StorageProviders#usage.. ah sorry you already noted that.. do you not just add the cdnMediaUrlProvider as well as the blob storage.. azure blob storage is where things are saved.. cdnmedia is where they are retrived from? (https://github.com/umbraco/Umbraco.StorageProviders/blob/d3170103c6ed17fe355e6bd49156bb05e9b80699/src/Umbraco.StorageProviders/CdnMediaUrlProvider.cs#L15)
c

crlogan

10/02/2023, 11:08 AM
ah ok I thought it was either azure specific one or the general storage account one, not both
so I have .AddAzureBlobMediaFileSystem() but not .AddCdnMediaUrlProvider(), should I have both?
m

mistyn8

10/02/2023, 12:20 PM
I think that's how I read it.. have you also set up azureCDN infront of your blob storage? Or some other CDN provider using blob storage as the datasource?
c

crlogan

10/02/2023, 12:23 PM
yeah azure cdn
I have the url
I will give it a go using both I think I maybe just misunderstood the docs
Just to confirm this worked having both there @mistyn8 , thanks for the advice. I think I just misunderstood the docs.
5 Views