How to deploy Angular on Azure

With Azure App Service Plugin

Install Azure App Service Plugin

Go in extensions and research Azure App Service, then install the plugin. After that, go on the new extension and connect your azure account on it. You should be able to see your subscriptions, resource groups and Web App.

Create web.config file

For IIS server, web.config is needed to help it finding your website and the root path. Therefore, you will also need to add your web.config inside you app. You put your web.config inside the folder src of your application. Inside your web.config put this code:

After that, you will need to inform your application to include this file after the compilation of this one. you go inside your angular.json and you add the reference to the file there:

Building the application

You will need to build your application. Therefore, put in your terminal: ng build. That’s it.

Go in your App service extension

Do a right click on the webapp to deploy (what) on it. You click on deploy and a pop up will appear to you, say yes and then browse inside your folder. After that, go to dist/name-of-your-app and select folder and then it’s over. Your application will appear on Azure.

Leave a Reply