Search code examples
azureumbracoazure-blob-storageazure-app-service-envrmnt

Image URLs for Umbraco on Azure


I have an Umbraco (7.7.2) website on Azure and I've configured it to store images in blob storage (using Our.Umbraco.FileSystemProviders.Azure.AzureBlobFileSystem)

Then I my page I have (simplified):

 var image = Model.Content.GetPropertyValue<IPublishedContent>("image");
 <meta property="og:image" content="@image.Url" />

Which creates this HTML:

 <meta property="og:image" content="/media/1030/image1.jpg" />

The code works fine and shows the images, but I wonder if I should have the URL to Blob storage instead?

What will happen now when a request goes for /media/1030/image1.jpg? Will it hit the app service everytime before reading the file blob storage or will it hit the blob storage directly?


Solution

  • Apologies if I don't understand your question, but I feel the need to point out that the AzureBlobFileSystem package provides a Virtual Path Provider. This essentially re-routes any calls from /media/... to your blob storage container, so the images you are supplying are actually coming from your blob storage container and not the file system.

    If I remember correctly, this is all configurable, so you can either change this to serve your standard blob storage URL's, or you can use one of the add-on CDN packages to serve Azure CDN URL's, if you would prefer.