AzureBlobCache and media container not called "media"
Has anyone come accross issues when using the azure blob cache and image processor
The following config fails to load any image crops, however if I rename the container from "websitename-media" to "media" and update the config to match the crops load fine.
Because I have several sites in the same account it is not possible to call all of the containers "media"
Setting this it to true works as long as your not using imageprocessor functionality, as soon as you need to it breaks it completely for any cache type, ironically only if you are not using 'media' as the container name.
Anyone know if this an umbraco issue or blobcache plugin one?
We use custom media container names in our azure file blob storage provider and useDefaultRoute set to true. But we do not use the blob cache so I would probably start by looking at the blobcache.
Can you update your cache to use the diskCache temporally to see if that's what's causing the issue?
SourceStorageAccount and SourceBlobContainer add overhead to the process since they check the source image to determine whether it has changed from when the image was originally uploaded. If you don't need this, don't bother with it.
Looking at the CachedCDNRoot you're not setting the CDN url, only the blob one.
Now. Back to the question....
I think I see where your confusion is lying.
Three things you need to understand:
ImageProcessor.Web and FileSystemProviders.Azure have no knowledge of each other.
ImageProcessor.Web has no knowledge of Umbraco, it is designed for any ASP.NET website.
ImageProcessor.Web only intercepts requests with commands width=100 etc.
So with that in mind, let's have a look at the following request.
This works with the useDefaultRoute setting set to false because the the source image is physically located within the website-media folder. and the path generated by Umbraco uses the relative path /website-media .
With the useDefaultRoute setting set to true, while the source image is physically located within the website-media folder, the path generated by Umbraco uses the relative path /media .
As such, no IImageServices know where to look for the source image!
I'm assuming your CloudImageService is set up to look something like this:
Hi jamse,
I have a problem with azure cdn + umbraco that you maybe can help.
I have 2 projects one umbraco 7.15.3 and the second is umbraco 8.6.1
both configured to work with azure storage and cdn (every project with its own storage)
both are working fine except for one problem with the umbraco 8
the flow is like this:
i upload an image from the umbraco backoffice media section.
i can see the image in the right folder in azure storage and i can see the thumbnail in umbraco media section
but when i click the image i can see the properties of it but no image :(
AzureBlobCache and media container not called "media"
Has anyone come accross issues when using the azure blob cache and image processor
The following config fails to load any image crops, however if I rename the container from "websitename-media" to "media" and update the config to match the crops load fine.
Because I have several sites in the same account it is not possible to call all of the containers "media"
<?xml version="1.0" encoding="utf-8"?> <caching currentCache="AzureBlobCache"> <caches> <cache name="AzureBlobCache" type="ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache, ImageProcessor.Web.Plugins.AzureBlobCache" maxDays="365"> <settings> <setting key="CachedStorageAccount" value="DefaultEndpointsProtocol=XXX" /> <setting key="CachedBlobContainer" value="websitename-cache" /> <setting key="UseCachedContainerInUrl" value="true" /> <setting key="CachedCDNRoot" value="https://xxx.blob.core.windows.net" /> <setting key="CachedCDNTimeout" value="1000" /> <setting key="SourceStorageAccount" value="DefaultEndpointsProtocol=XXX" /> <setting key="SourceBlobContainer" value="websitename-media" /> <setting key="StreamCachedImage" value="false" /> </settings> </cache></caches> </caching>
I've narrowed it down a little
In the security config if I change just the host to :
<setting key="Host" value="https:/website/media/"/>
rather than :
<setting key="Host" value="https:/website/website-media/"/>
everything works as it should as long as there is a duplicate container called "media"
Not sure what this means unfortunately
Is the container name for your AzureBlobFileSystem provider in filesystemproviders.config set to "websitename-media"?
It is yes.
I think I've found the issue but don't think its easily resolvable.
it seems to be a conflict with
<add key="useDefaultRoute" value="true" />'
in filesystemproviders.config
if this is set to false, and you attempt to access the media via the blob containers name the cache works fine eg
http://mywebsite/website-media/1001/image.jpg?crop-query-here
Setting this it to true works as long as your not using imageprocessor functionality, as soon as you need to it breaks it completely for any cache type, ironically only if you are not using 'media' as the container name.
Anyone know if this an umbraco issue or blobcache plugin one?
We use custom media container names in our azure file blob storage provider and useDefaultRoute set to true. But we do not use the blob cache so I would probably start by looking at the blobcache.
Can you update your cache to use the diskCache temporally to see if that's what's causing the issue?
Ok....
I can't see a config for the CloudImageService in your question so it's pretty much guesswork from here.
First things first, Let's have a look at your AzureBlobCache directory.
Config Notes:
SourceStorageAccount
andSourceBlobContainer
add overhead to the process since they check the source image to determine whether it has changed from when the image was originally uploaded. If you don't need this, don't bother with it.Looking at the
CachedCDNRoot
you're not setting the CDN url, only the blob one.Now. Back to the question....
I think I see where your confusion is lying.
Three things you need to understand:
width=100
etc.So with that in mind, let's have a look at the following request.
http://mywebsite/website-media/1001/image.jpg?crop-query-here
This works with the
useDefaultRoute
setting set tofalse
because the the source image is physically located within thewebsite-media
folder. and the path generated by Umbraco uses the relative path/website-media
.With the
useDefaultRoute
setting set totrue
, while the source image is physically located within thewebsite-media
folder, the path generated by Umbraco uses the relative path/media
.As such, no
IImageServices
know where to look for the source image!I'm assuming your
CloudImageService
is set up to look something like this:The key to letting ImageProcessor.Web know how to get the image would be to set the
prefix
value to the following.prefix="media/"
That way it still requests the correct blob but can recognise the url generated by Umbraco.
Does all that make sense?
Hi James.
Thanks for your explanation - makes it does make sense and essentially all I was missing was the prefix as you suggested!
Thanks for your help with this!
Carl
Great Carl!
Very happy I was able to help, any other issues don't hesitate to ask.
Cheers
James
Hi jamse, I have a problem with azure cdn + umbraco that you maybe can help. I have 2 projects one umbraco 7.15.3 and the second is umbraco 8.6.1 both configured to work with azure storage and cdn (every project with its own storage) both are working fine except for one problem with the umbraco 8
the flow is like this: i upload an image from the umbraco backoffice media section. i can see the image in the right folder in azure storage and i can see the thumbnail in umbraco media section
but when i click the image i can see the properties of it but no image :(
i made number of test and realized that when i use the imageprocessor the image is served with no problem (that is the reason that i can see the thumbnail in umbraco backoffice, the url is http://localhost:6365/media/53lfufg3/call.png?width=500&mode=max&animationprocessmode=first it uses the imageprocessor and everything is working) but when I request the image like http://localhost:6365/media/53lfufg3/call.png i get nothing
any idea? please help if you think of anything that can cause this behavior thank you
is working on a reply...