0

I'm running an Angular app and a .NET Core API on an App Service. I need to update the web.config to handle refreshing as shown in this answer.

But my app doesn't have a web.config as it is, and when I tried to add one in the Angular app, publishing failed. Is there a way to modify the web.config through the Azure portal, or another way to accomplish the above?

The code repo if that helps.

muttley91
  • 12,278
  • 33
  • 106
  • 160

1 Answers1

1

When I tried to run your given repo in my local, I got the below warning.

enter image description here

  • If you want to add the Web.config file to Angular App before deploying to Azure App service, then follow the below steps.

  • Open the Angular Application root directory.

  • Add the web.config file in the src root directory.

  • Open the Package manager console and run ng build.

npm install
npm install --save-dev @angular-devkit/build-angular
ng build
  • A new folder with name dist will be created. Now re-deploy the app again.

Is there a way to modify the web.config through the Azure portal.

If you have deployed your application to Azure Windows App Service, then we can create the web.config file within the deployed Application Angular root directory from KUDU Console.

Open the KUDU console by using the below URL,

https://YourAppServiceName.scm.azurewebsites.net/

enter image description here

enter image description here

  • Make sure you are creating webconfig file in the Angular Application root directory.

  • If your application is deployed in Azure Linux App Service, then you need to create .htaccess file as mentioned in the Link which you have shared.

To deploy the Angular app and .NET Core API to Azure App servicewithout any issues, follow the SO Thread 1 and 2 for more details.

Harshitha
  • 3,784
  • 2
  • 4
  • 9