Azure CDN for App Service

Paul McCaffery 0 Reputation points
2023-02-07T11:05:02.46+00:00

Hi,

I am trying to understand Azure CDN offerings and would like something clarifying about the behaviour of it.

I have an App Service which hosts my ASP.NET website and it serves a bunch of static content such as images, sound files and bundled JavaScript files.

I would like to offload the serving of these files from my app service since they are static by nature.

Can I simply associate a CDN with the App Service in the portal without the need to hardcode new URLs in my application? Or do I need to write into my deployment that relative urls need converting from /scripts/bundle.js to https://mycdnurl.azure.net/scripts/bundle.js

It seems a bit of an upheaval to alter my deployment scripts to upload the static content elsewhere and then change my urls in the deployed site.

Or is Azure able to intercept the request to my static content from a client e.g. www.mysite.com/scripts/bundle.js and serve it from azurecdn.net/scripts/bundle.js

I have done some reading but I am not clear how it really works and if this can all be simply configured from the portal without much additional work.

Thanks in advance for any forthcoming help.

Paul

Azure Content Delivery Network
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,865 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 55,601 Reputation points
    2023-02-07T17:26:11.9933333+00:00

    you all need to change the url on the web site, and deploy the wwwroot to the azure cdn.

    deploy wwwroot to azure can

    you could create a tag helper for links.

    0 comments No comments

  2. Paul McCaffery 0 Reputation points
    2023-02-09T10:22:24.2333333+00:00

    Sounds like Clouldflare will be a better option for me then. I don't really want additional deployment steps.

    Thanks for the answer though

    0 comments No comments