This is on Windows 10, running `angular-cli` in command prompt Administrator mode.
ng new myapp
cd myapp
ng serve -prod
At that point we have a deployable Angular2 app! Thank you Angular team, and I am very happy that the `-prod` command is working on Windows.
And then running `azure-cli`, with an azure subscription set up and azure-cli logged in.
I had to modify the angular-cli project with these steps for it to work with Kudu on Azure:
- Modify package.json, change "script": "start": "ng serve", to "start": "ng serve -prod", If you want the prod version
- Add a file at the root of the project (same level as package.json) called ".deployment". This file will tell KUDU where our project is. The contents of .deployment are:
Then you can use this azure-cli command:
azure site create --git <yoursitename>
Then run git as your normally would
git add .
git commit -m "initial"
git push azure master
git push azure master tells KUDU to deploy the site. Wait a few minutes and voila!
That's really, really cool! Spin up an Angular2 site on Azure in about 10 minutes.