user14692794
user14692794

Reputation:

The serve command requires to be run in an Angular project - Azure App Service (.NetCore and Angular app)

I have an Angular and.NetCore app that I am deploying to Azure App Service (Windows).

I use Azure Pipelines, here is my pipeline configuration Pipeline Config

When I deploy to app service this is my folder structure. Whole App Service

This is inside my ClientApp folder. ClientApp Folder

I get this error, I have been trying for 2 weeks now.

The serve command requires to be run in an Angular project, but a project definition could not be found. fail: Microsoft.AspNetCore.SpaServices[0]
      The serve command requires to be run in an Angular project, but a project definition could not be found.

Please help me and tell me where I have missed my configuration. Thank You, everyone🙏

Upvotes: 0

Views: 376

Answers (1)

user14692794
user14692794

Reputation:

Well, I finally found the solution. You cannot run ng serve because obviously, it should be static file rendered. The problem was the env variable not set to "Production". Then you need to have the folder structure like "ClientApp/Dist".

The second issue was not using --prod.

Hope this saves someones time.

Upvotes: 2

Related Questions