Hi,
I am looking into setting up a Swift on a Azure web app and it is looking good so far. The site and database are running fine and the performance is also good. So far, so good.
The images are stored on the web app (Swift), and while it is working fine, it is apparently not the way to go on Azure. Everyone says that images and other static files should be stored in Azure Storage.
Therefore, I uploaded the images to Azure storage File Share and mounted the File Share to the Swift webapp and set up a virtual path for the Images folder.
The result:
- Images were loaded correctly when called by direct path ({DOMAIN}/Files/Images/image.jpg)
- Images were NOT loaded when called with the image handler ({DOMAIN/Admin/Public/GetImage.ashx?image=image.jpg)
- The images were not accessible from the Images-folder in the Files-section of the backend
I then read this forum post https://doc.dynamicweb.com/forum/cms-standard-features/cms-standard-features/getimage-on-a-seperate-domain, which suggests that I get the images from another application, so I created another webapp (Swift CDN) with the same version of Dynamicweb in order to be able to use GetImage.ashx. I copied all files from the /Files-folder into a file share and mounted that on the new wep app. The structure of the web apps are now as follows:
Swift
Admin (web app)
bin (web app)
Files (web app)
{All subfolders} (web app)
Swift CDN
Admin (web app)
bin (web app)
Files (Azure storage)
{All subfolders} (Azure storage)
In the settings of the Swift wep app I then set the CDN host for GetImage.ashx to the Swift CDN web app's domain. And that mostly works. The GetImage.ashx calls prefixed with the Swift CDN domain and the images are generated as I had hoped for with a few exceptions:
- BUG: The calls to GetImage.ashx in the srcset attribute of the img-elements are not automatically prefixed with the CDN domain.
- Some Swift templates are expecting that the images exists on the solution and throws an exception, when they do not. E.g. Paragraph/Swift_Feature.cshtml
Also, the images cannot be selected when editing content, which makes sense. A solution to this problem could be to also have Swift templates and item types on the Swift CDN. The Swift CDN should then be hooked up to the same database, so editors can edit content there in order to select images while editing the content.
It just gets too complicated, so my wish is to be able to have the following setup, and that GetImage.ashx will work with that setup.
Swift
Admin (web app)
bin (web app)
Files (web app)
Images (Azure storage (virtual directory))
{All other subfolders} (wep app)
Or is there another way to make this work?
Kind regards,
Roald