In the examples one can find online on how to integrate a CDN into an MS MVC application, we see typical examples using the CDN of common libraries like jQuery:
See "Using a CDN" at http://www.asp.net/mvc/overview/performance/bundling-and-minification
It's plain and simple:
But what if you want to use your own scripts through a CDN like Azure? This works nicely (in BundleConfig):
where CdnRoot is the path to the CDN endpoint, like: //my-endpoint.azureedge.net
This way, the CDN will load the resources from the bundle like in a normal case, store it in its cache, and return it the next times a user requests them. No need to upload the files to the CDN, and changes to the code behind the bundle is taken into account automatically.