Hi guys today we are going to discuss on how to deploy multiple projects in a single webapp on microsoft azure.
As a developer sometimes we have to make and deploy multiple web projects in a solution due to requirement or other constraints. It was easy when we were using our old loving IIS where we can configure multiple virtual directories within a site and run the applications within the same site.
Here i am taking a scenario where i have a UI project for front end which we will deploy in root and the back end for administrators that we made separately and will be deployed in the Admin virtual directory of the azure web app
Prerequisites
- You should have active subscription to Microsoft azure
- You should have projects ready for deployment
Settings on Azure Portal
- Login to Microsoft Azure portal
- Choose your web app from dashboard previously known as website on old azure portal
- Go-to settings section of web app from left navigation bar
- Click on application settings
- Scroll down and you will find a section named Virtual applications and directories
It will have default entry for wwwroot folder of your app - Now we have to add our admin virtual directory to deploy back end of our application
Now we have to add virtual directory name in our case it is admin.
So our virtual directory name in the setting will be /Admin and physical path relative to site root will be site\Admin .
Don’t forget to check the application check box as we are running a separate application in this virtual directory - On top left of this page please Save these settings after making the necessary changes according to your requirement to apply the changes on azure
- Now we are good to go and deploy our project on Windows azure.
Deployment from visual studio
- You can deploy your root application by using your default profile the process that you already know. If you don’t then please check the article on how to publish from visual studio to windows azure
- Now if have to deploy our admin section to the virtual directory that we created we need to append the virtual directory name in site name and destination url
- Once the publishing is done, you’ll have your multi-project solution successfully deployed in separate virtual directories within a single Azure Webapp.
Note: When you are deploying application in the root of the Azure Website, make sure that the “Delete All Files” is NOT checked, or it may remove your application and virtual directories.
Happy deploying 🙂
[…] Note: There are lot of settings and configurations of azure that we can do while publishing or before publishing. Please feel free to comment and ask questions so that we can do a tutorial on those settings. You can also see the tutorial on Deployment of multiple projects in single azure web app […]
I enjoyed readig your blog.
I want to thank you for the hard work.
I enjoyed your wonderful blog.
Thank you for the very hard work done.