Using the Media Library with Azure Blob Storage, Azure CDN and Content Staging

Peter Vanderhoef asked on September 27, 2022 17:22

Hi,

We are setting up Kentico 13 environments for a client and ran into a snag with configuring the media library (we used the guide here).

We have successfully configured the media library to use Azure Blob Storage and have it working with Azure CDN, the snag we ran into is with content staging. To have it run through the CDN, we set the media library to use direct links (e.g., https://cdn.mysite.com/path/filename.jpg) which works great. In the guide above, it says to use permanent links (e.g., ~/getmedia/GUID/filename.jpg) if we want to use content staging. The problem is that if we use permanent links, it's not using the CDN URL and therefor not leveraging the CDN.

Unless I am missing something, is it possible to use both the CDN and content staging with the media library? If so, how does Kentico translate the permanent link to the CDN link?

Thanks!

Correct Answer

Brenden Kehren answered on September 29, 2022 15:40

For this I think you have 3 options:

  1. Use the same blob storage and CDN for staging as you do production (not ideal)
  2. Create some sort of custom output filter to rewrite those CDN URLs on production (can be a performance hit during live site rendering)
  3. Create a global event handler that checks data during the staging process then finds and replaces the non-production CDN with the production CDN.

Several ways to handle it, just have to choose what works for you.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Peter Vanderhoef answered on September 29, 2022 18:15

Ok, this is kind of what we had in mind just weren't sure if we were missing a Kentico configuration. We are leaning towards the second option.

Thank you for confirming this!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.