generator-aspnetcore-angular2 icon indicating copy to clipboard operation
generator-aspnetcore-angular2 copied to clipboard

Azure App Service deployment issues

Open bradygaster-zz opened this issue 8 years ago • 2 comments

This may not be a bug, could be a design consideration, but it'd be good if we could figure out how to mitigate azure app service deployment issues.

This segment of code in the template causes deployments via Git to azure app service to throw errors during startup. I'm not sure if this is due to the node_modules folder needing to be populated in the wwwroot folder at build-time, or if there's a potential workaround that could be implemented to avoid this.

Maybe what we could do is have a two-app scenario? In which the API is one app, and the ng2 client app is another app? That way, the API end of things wouldn't need to serve the static content.

bradygaster-zz avatar Sep 29 '16 19:09 bradygaster-zz

why excuse me Sir. I use your lib, but when I ran the code, I got this error. could you help me ? this is my project : https://github.com/epiii/rplExercise/tree/master/aspAngu thanks in advance

epiii avatar Oct 14 '16 23:10 epiii

@bradygaster I created an Azure web app and set it to automatically deploy from this repository. I ran into the same issue as you, but I was able to workaround it by making the following changes:

  • Modify the project.json to include a prepublish command to run npm install and tsc, and add the node_modules directory in the include section.
  • Modify the package.json file to merge the dependencies and devDependencies sections
  • Modify the WEBSITE_NODE_DEFAULT_VERSION environment variable under the application settings section in Azure portal to something newer like 5.6.0

You can see it working here.

I do agree that for a sufficiently large application, it may be best to split this up into two apps. How would you like to proceed? Would you like to submit a PR for these changes, or would you like to explore the two-app scenario further? I also planned on adding the features in this repository as another option to this generator, that way there will be an option to generate a more advanced project that uses webpack, karma, protractor, ts2, universal, etc., so I'll probably need to make those changes there as well.

@epiii I've created a separate issue for your questions here.

sgbj avatar Oct 15 '16 16:10 sgbj