2
votes

In my local IIS server, i have created a IIS website and deployed 3 ASP.NET web application such that they will have URL like IIS URL/webapp1 , IIS URL/webapp2 , IIS URL/webapp3 and it works like charm. I am able to deploy only one web application in Azure webapp and not others.

Can i deploy more than one web application in one Azure web app ? If yes, then how ?

2
Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Super User or Unix & Linux Stack Exchange would be a better place to ask.jww

2 Answers

5
votes

My solution is described below. First create a sample AzureWebsite -

enter image description here

Setup up an additional application in the AzureWebsite as follows. Navigate to Configuration tab and create an application as shown below – enter image description here

By creating above application we reserved / to MVC site and then /webapi to webapi endpoints.

Lets say you want to publish MVC and Web API projects from VS Solution as shown below.

enter image description here

Download publishsettings file of above created AzureWebsite. Import the publishsettings file to the Visual studio MVC project (right click the project and select publish) as shown below -

enter image description here

Similarly publish the WebApi project by importing the same publishsettings file. But we need to change the Destination URL and Site name to the newly created application details. Please check below screenshot –

enter image description here

Publish both the projects.

Now navigate to http://ramidev1.azurewebsites.net for the MVC site. And navigate to http://ramidev1.azurewebsites.net/webapi/api for WebApi endpoints.

2
votes

Yes, you can do that with virtual directory.

Quote from Add virtual directory to existing website on Azure

Virtual Directories are supported for Azure Websites. See Configuring Azure Websites for what you can do through the Azure Management Portal. From the Azure Portal, click on the Website and go to Configure, then scroll down to virtual applications and directories (the last config section). Just enter your virtual directory and the physical path relative to the site root and click Save.