0

Where does the wwwroot folder go when I use "Publish" inside Visual Studio to deploy to Azure Web Apps?

When new instances are created, where does wwwroot folder comes from?

Is wwwroot referenced inside Azure Storage or is it in the local storage of each instance?

How to serve wwwroot files from Azure CDN instead of serving from Azure Web Apps?

Gustavo Piucco
  • 467
  • 1
  • 7
  • 17
  • I answered the first part of your question, but I did not quite get the second part. Do you mean you are publishing from Visual Studio to Web Apps, and are wondering how to clear the CDN cache so new versions come through? Cache busting is your answer in that case :) – juunas Mar 08 '18 at 18:03
  • I am wondering how serve wwwroot files from Azure CDN instead of serving from Azure Web Apps Instances – Gustavo Piucco Mar 08 '18 at 18:54
  • 1
    Ahh, well that should only require you to setup the origin URL in Azure CDN correctly. I'll add info about that in the answer. – juunas Mar 08 '18 at 19:16

1 Answers1

2

As described here in the Kudu docs: https://github.com/projectkudu/kudu/wiki/Understanding-the-Azure-App-Service-file-system:

The storage is shared across your instances. Azure Storage is used behind the scenes for this.

The storage is also persistent.

As for setting up the CDN to serve files from your Web App, you can refer to documentation here: https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-content-delivery-network?toc=%2fazure%2fcdn%2ftoc.json.

If you setup the origin hostname as yourapp.azurewebsites.net, then content that would be accessed via yourapp.azurewebsites.net/myimage.png can then be accessed via CDN from yourcdn.azureedge.net/myimage.png.

juunas
  • 54,244
  • 13
  • 113
  • 149