How can can I deploy an angular 2 webapp to azure? I guess I need some type of final compilation script.
Thanks in advance.
I can move you part of the way to a solution, but I cannot fully answer your question. So, if the SO monitors want to delete this response, please feel free.
I am trying to get an Angular CLI application to deploy to Azure from Bitbucket. You have two options:
1) Pre-build your application for deployment using a service like Jenkins or Codeship. Shane Boyer has a working solution using Github and Codeship here: http://tattoocoder.com/angular2-azure-codeship-angularcli/
This option seems most desirable b/c you only have compiled code on your server. I am trying to figure out how to work with Jenkins to accomplish this with angular-cli.
2) Copy your code to the server and run the build there. This seems undesirable b/c it will leave source code on your server. I have this option 90% done.
My build was/is failing b/c of missing npm packages.
First, I changed my environment so that it was using a more recent version of Node and this helped. You can do this by opening settings on your Web App and going to Application Settings. In the App settings section of the Application settings tab, you should have a set of key/value pairs. One of those should be for WEBSITE_NODE_DEFAULT_VERSION. On my app, I have access up to version 6.1.0 which I am using. Set yours to the appropriate version. You can also set this in your packages.json file following the instructions here: https://azure.microsoft.com/en-us/documentation/articles/nodejs-specify-node-version-azure-apps/ . Changing it in App settings allows you to use that version in you command line window which I needed to get npm packages installed.
Next, go to your command line and try to install your missing packages. I have had mixed success here. Initially, my build was failing b/c typings was not installed. I was able to install it globally once I had updated Node.
I ran into problems installing angular-cli. I have not gotten a good log of that failure, even using -dd. Essentially, it copies all the files then fails returning a 'bad request' error and no log regardless of the switches I use. I believe it is failing while trying to modify the npm environment to add ng.cmd. I am currently investigating this.
Hopefully, this will move you a little farther along.
Good luck.