Christer
Christer

Reputation: 1681

Azure - Static HTML/CSS/JS as Virtual directories in Web apps

im migrating my entire old project setup to Azure, but i cant get my static file content to load.

I got a repository with a folder structure like this:

/2015/ <- Static HTML (index.html)
/2016/ <- Static HTML (index.html)
/2017/ <- MVC app

The project is setup against my github account, so it deploys whenever something is comitted.

This makes the MVC app get deployed to site\wwwroot and my appSettings currently points the root / of the application towards site\wwwroot. I also want to be able to "hit the archives" of old sites, so that if i go to /2016 - that would then point to the /2016/ folder of the repository - But i cant get this to work.

I have tried pointing /2016 to site/repository/2016 - but when trying to load up the site i get the following error The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Anyone got any idea on how to achieve this functionality?

Upvotes: 1

Views: 636

Answers (1)

David Ebbo
David Ebbo

Reputation: 43183

You'll need to make these virtual applications and not just directories (there is a checkbox in the UI). Otherwise, the requests will still be handled by your MVC application.

In addition, as we discussed in chat, you'll need to move parts of your root web.config under <location path="." inheritInChildApplications="false"> attributes so it doesn't get inherited by the sub app (which can mess it up).

So it can all be made to work, but clearly things are easier if you use separate Azure Web Apps for each :)

Upvotes: 2

Related Questions