Reputation: 189
We are trying to migrate a .NET 4.5 web application to azure from a dedicated IIS server and we are running into an issue with virtual directories. We have the need to have several virtual folders created in a subfolder on the website. In the Azure portal we can only create a virtual folder that maps to the root of the application.
The creation of the virtual folders is handled by Microsoft.Web.Administration in our Application startup.
Here is an example of what we are trying to do
app.com/sub/aspxfolder/ - location of the ASPX code
app.com/sub/aspxfolder-v1/ - virtual path to above code
app.com/sub/aspxfolder-v2/ - virtual path to above code
The pages render differently depending on the requesting URL.
Upvotes: 1
Views: 811
Reputation: 5160
When you create Virtual directories in Azure, make sure you put them in order of least depth to most depth. For example:
Virtual Directory | Relative Path to Site Root
/sub | site\wwwroot\sub
/sub/aspxfolder | site\wwwroot\sub\aspxfolder
Will work, while:
Virtual Directory | Relative Path to Site Root
/sub/aspxfolder | site\wwwroot\sub\aspxfolder
/sub | site\wwwroot\sub
Won't work. I've run into this before with other features in Azure. I think this is the issue you're running into.
Upvotes: 3