It can be adapted from the existing CloudFront plugin.
<add name="AzureCDN" />
<azurecdn redirectThrough="https://azxcxcxcxcxcx.vo.msecnd.net" redirectPermanent="false" />
That is basically the CloudFrontPlugin.cs with altered references to web.config, without TransformCloudFrontUrl and with regular querystrings because Azure CDN has no problem with them.
needs an extra line:
c.Pipeline.RewriteDefaults += new Configuration.UrlRewritingEventHandler(Pipeline_RewriteDefaults);
void Pipeline_RewriteDefaults(System.Web.IHttpModule sender, System.Web.HttpContext context, Configuration.IUrlEventArgs e)
//Always request caching for this VPP. Will not override existing values.
if (vpp.IsPathVirtual(e.VirtualPath)) e.QueryString["cache"] = ServerCacheMode.Always.ToString();
Both copied from ImageResizer\Plugins\S3Reader\S3Reader.cs
I have this working in my solution
Azure now supports querystring preservation, making this irrelevant.
Azure CDN now supports querystring preservation, so I don't think this idea is relevant any longer; no plugins are required for Azure or CloudFront when they are configured properly.
Yes, I can confirm that the CloudFront plugin does work unmodified, but the changes to AzureReader.cs are required to make it work
Well, it's already generic in everything except name. I agree a name change is needed, but it should work unmodified for your scenario.
(and sorry for my late reply: I didn't have "Receive comment updates" checked)
RE: Would it be easier to just use the CloudFront plugin as-is?
You mean adapting the CloudFront plugin to a generic CDN plugin that you point to the required CDN via configuration? Yes!
But then you would also have to change the name(space) of the plugin.
Would it be easier to just use the CloudFront plugin as-is?
UPDATE: I was wrong about TransformCloudFrontUrl and the regular querystrings. My AzureCDNPlugin.cs now looks like this: http://pastebin.com/9ZXem43Y