I was helping a customer this past week, and when deploying his Angular code into a web app, the following error message was being displayed:
More than often, the problem is where the web app is configured to look for the web application files vs. what is set on the code. To perform this simple check, you can check Kudu tools in the web app, and then click on the Debug Console, and select either CMD or PowerShell.
The interface is simple. Start by clicking on the graphical Windows explorer. The prompt will change automatically to reflect the navigation steps that you are performing. By default, the web app running on Windows will have the site configuration on home\site\wwwroot.
As you can see in the example below, the developer added one extra folder as the root of his application. To solve the problem, we have two simple ways: First, talk to the developer and remove that folder and ask him or her to drop all the files in the root without additional folders. The second approach is to modify the configuration files.
I'm working on my diplomatic skills lately, so I decided to take the second approach. We need to go to the Configuration item in the web app, then click on Path mappings, and configure the physical path to reflect how your application is being published, as depicted in the image below.
More Quick Tips articles
- How to quickly check the status of all your Azure services
- Using location in a consistent way in your ARM template parameters
- Using environment as variables in your Azure DevOps pipelines
- Removing Log Analytics with the soft-delete option
- Using conditions in ARM templates when deploying infrastructure-as-code