Seamless Media Management: Integrating Cloudinary with Sitecore
Written by Hemapriya Senthilkumar September 2026
Visual storytelling is critical, and media is usually the heaviest thing on a page. Integrating Cloudinary with Sitecore gives marketers faster publishing and developers a cleaner way to handle media — without bloating the content database.
In today's digital-first world, content is no longer just words — visual storytelling is critical. Whether it's ensuring your homepage loads fast or making sure a campaign image looks right on every device, media handling has a direct effect on both experience and performance.
For organizations using Sitecore to manage content, integrating with Cloudinary offers a scalable solution for media delivery. With features like automatic optimization, responsive transformations and CDN delivery, it addresses problems that are otherwise solved by hand, repeatedly.
This article highlights the benefits of integrating Cloudinary with Sitecore — simplifying media workflows for marketers and offering a scalable, efficient solution for development teams.
For marketers: how Cloudinary adds value
Managing brand consistency across channels, meeting campaign deadlines, and optimizing for performance are daily challenges for marketing teams. Cloudinary helps with all three.
1. One asset, endless possibilities. Upload a single high-quality image, and Cloudinary automatically generates optimized versions for various channels — including web, mobile and social — without a design request for each one.
2. Faster pages, better SEO. Heavy images slow down your site and impact search rankings. Cloudinary optimizes and compresses media assets automatically and serves them from a CDN.
3. Consistent branding made simple. Cloudinary's built-in Digital Asset Management (DAM) system allows you to:
- categorize assets by campaign or usage
- apply brand-safe transformations like cropping or watermarks
- maintain a cohesive visual identity across all digital touchpoints
4. Speed up content publishing. Crop, transform and preview media directly through Sitecore with Cloudinary's APIs or UI plugins — without needing Photoshop.
For the tech team: how Cloudinary adds value
1. Media upload and sync. Automatically sync Sitecore Media Library uploads to Cloudinary using item:saved events.
2. Responsive and optimized delivery. Use Cloudinary's transformation API to serve device-specific, auto-formatted images with minimal coding effort.
3. Maintain image quality at scale. Reduce media payloads with f_auto, q_auto and intelligent cropping without sacrificing quality.
4. Decouple storage from delivery. Avoid bloating Sitecore databases with heavy media files — offload delivery to Cloudinary's CDN.
Example: steps to integrate Cloudinary with Sitecore
1. Set up your Cloudinary account
Create an account. If you don't have a Cloudinary account, sign up at Cloudinary's website.
Get API credentials. Access your Cloud Name, API Key and API Secret from the Cloudinary console.
2. Configure Cloudinary in Sitecore
Add Cloudinary settings to your Sitecore configuration. Place the configuration file in App_Config/Include.
<configuration>
<events>
<event name="item:saved">
<handler type="Project.Foundation.Module.Events.CloudinaryItemSavedHandler, Project.Foundation.Module"
method="OnItemSaved"/>
</event>
</events>
<mediaLibrary>
<mediaProvider>
<patch:attribute name="type">Project.Foundation.Module.Processor.CloudinaryImageMedia, Project.Foundation.Module</patch:attribute>
</mediaProvider>
</mediaLibrary>
<settings>
<setting name="Cloudinary_BaseUrl" value="https://assets.baseurl.org/"/>
<setting name="Cloudinary_Cloud" value="Cloud ID"/>
<setting name="Cloudinary_ApiKey" value="ApiKey"/>
<setting name="Cloudinary_ApiSecret" value="ApiSecret"/>
<setting name="Cloudinary_IsResponsive" value="true"/>
<setting name="Cloudinary_FormatAuto" value="true"/>
<setting name="Cloudinary_QualityAuto" value="true"/>
<setting name="Cloudinary_MediaUrl" value="site URL"/>
</settings>
</configuration>
Keep the API secret out of source control. The values above are placeholders; in a real deployment they belong in a secret store rather than a patch file.
3. Implement a Cloudinary service
Develop a service to interact with Cloudinary's API using the Cloudinary .NET SDK.
using CloudinaryDotNet;
using CloudinaryDotNet.Actions;
public class CloudinaryService
{
private readonly Cloudinary _cloudinary;
public CloudinaryService()
{
var account = new Account(
ConfigurationManager.AppSettings["Cloudinary.CloudName"],
ConfigurationManager.AppSettings["Cloudinary.ApiKey"],
ConfigurationManager.AppSettings["Cloudinary.ApiSecret"]);
_cloudinary = new Cloudinary(account);
}
public ImageUploadResult UploadImage(Stream imageStream, string fileName)
{
var uploadParams = new ImageUploadParams
{
File = new FileDescription(fileName, imageStream)
};
return _cloudinary.Upload(uploadParams);
}
public string GetImageUrl(string publicId)
{
var urlParams = new UrlParams { PublicId = publicId };
return _cloudinary.Api.UrlImgUp.BuildUrl(publicId, urlParams);
}
}
4. Upload images from Sitecore automatically
Adapt Sitecore's media library handlers to use the Cloudinary service for media management, so the file is uploaded to Cloudinary when an image is saved in Sitecore.
The OnItemSaved method ensures that it only processes items in the /sitecore/media library/ path and checks for Jpeg or Image templates, as these are the types that carry a media stream.
public void OnItemSaved(object sender, EventArgs args)
{
try
{
var savedItem = Event.ExtractParameter(args, 0) as Item;
if (savedItem == null ||
!"master".Equals(savedItem.Database?.Name, StringComparison.OrdinalIgnoreCase))
{
return;
}
if (!savedItem.Paths.FullPath.ToLower().StartsWith("/sitecore/media library/") ||
(!savedItem.TemplateName.Equals("Jpeg", StringComparison.OrdinalIgnoreCase) &&
!savedItem.TemplateName.Equals("Image", StringComparison.OrdinalIgnoreCase)))
{
return;
}
var image = new MediaItem(savedItem);
var mediaUrlOptions = new MediaUrlBuilderOptions
{
AlwaysIncludeServerUrl = false
};
var publicId = image.Name.Replace("-", "").Replace(" ", "");
var mediaUrl = MediaManager.GetMediaUrl(image, mediaUrlOptions);
var mediaStream = image.GetMediaStream();
var cloudinary = new Cloudinary(new Account(
Settings.GetSetting("Cloudinary_Cloud"),
Settings.GetSetting("Cloudinary_ApiKey"),
Settings.GetSetting("Cloudinary_ApiSecret")));
var uploadParams = new ImageUploadParams
{
File = new FileDescription(publicId, mediaStream),
Overwrite = true,
Invalidate = true,
PublicId = publicId
};
var response = cloudinary.Upload(uploadParams);
if (response.StatusCode == HttpStatusCode.OK)
{
Log.Info($"Cloudinary Sync - Successfully Uploaded {response.PublicId}", this);
}
else
{
Log.SingleError($"Cloudinary Sync - Failed to Upload {uploadParams.PublicId}. Error: {response.Error?.Message}", this);
}
mediaStream.Close();
}
catch (Exception e)
{
Log.SingleError($"Cloudinary Sync - Unexpected error while trying to Upload Images to Cloudinary. Exception: {e}", this);
}
}
In summary
By integrating Cloudinary with Sitecore, you bring together speed, consistency and control — all from a single platform.
- Marketers gain faster publishing and brand-safe visuals.
- Developers enjoy a clean, maintainable solution that offloads media handling.
- Users get fast performance and quality media, on every device.