manishKungwani
manishKungwani

Reputation: 925

How to use Windows Azure CDN with existing ASP.NET webforms application?

I have an ASP.NET Web Application on Azure and want to move my static content - images, CSS to the Azure CDN.

I have over 100 image files being used throughout the application stored in a folder "App_Themes/img" ...

In what way, can I minimize the effort in the move?

My current steps would be ... - Manually upload all files to cdn .. - Manually change all urls to the cdn (using Ctrl-H, but still is time-intensive and not error free) - Somehow manage the testing locally... (Add some code at every page to use a baseurl, depending on debug or release) ...

Is there any way that I could add a new route, etc so that I don't have to manually change the urls, as well as move between file-system urls and CDN to develop the application locally and deploy it.

Thanks a lot ..

Upvotes: 2

Views: 1019

Answers (2)

manishKungwani
manishKungwani

Reputation: 925

What I did was added a config entry in the web.config:

and replaced path /App_Themes/SpringDoctor/images/ with <%=System.Configuration.ConfigurationManager.AppSettings["ImagesPath"]%>

And upload all images to the appropriate blob.

Upvotes: 0

user728584
user728584

Reputation: 2135

I think you can do this via IIS URL rewriting or move static content into a /cdn folder, I haven't tested this but Maarten Balliauw has a great blog post on how serve content from the CDN. "Using the Windows Azure Content Delivery Network"

Upvotes: 2

Related Questions