0
votes

I have an Azure App Service which has two virtual applications (Asp.Net Core Blazor apps, if it's important) hosted within it. The virtual application URLS are something along the lines of

https://site.azurewebsites.net/site1

https://site.azurewebsites.net/site2

I have noticed that some of the internal routing seems to not be taking the virtual application path into account. For example, a link that takes the site to the "/" route navigates to https://site.azurewebsites.net instead of the appropriate "base" virtual application path. Is there some way of either handling this in my application or within the azure configuration?

Thank you for any assistance!

2

2 Answers

1
votes

Adding to Hassan's suggestions, on App Service, Each app has the default root path (/) mapped to D:\home\site\wwwroot, where your code is deployed by default. If your app root is in a different folder, or if your repository has more than one application ( as in your case), you can edit or add virtual applications and directories here.

To configure virtual applications and directories, specify each virtual directory and its corresponding physical path relative to the website root (D:\home). Optionally, you can select the Application checkbox to mark a virtual directory as an application.

From Azure Portal > Navigate to your WebApp -> Settings (Configuration)-> Path Mapping> Virtual applications and directories.

enter image description here enter image description here

0
votes

if you browse via console Kudu console in your app service blade you will notice a directory, under wwwroot is the root directory which by default your application routes to. This you can change from App Settings blade option. Also in this directory you will find you can create other folders aka virtual applications which will work the way you want it to.