Deploying angular-cli to AZURE with azure-cli and KUDU automated deployment!

1,097 views
Skip to first unread message

Jonathan Matthew Beck

unread,
Jun 27, 2016, 1:37:18 PM6/27/16
to AngularJS
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:

  1. Modify package.json, change "script": "start": "ng serve", to "start": "ng serve -prod",     If you want the prod version
  2. 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:
    [config]
    project = dist
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.

Jonathan Matthew Beck

unread,
Jun 28, 2016, 9:42:38 PM6/28/16
to AngularJS
ps - you may need to do this

Copy the following modules in the "devDependencies" section to "dependencies" section in package.json "concurrently": "^2.0.0", "typescript": "^1.8.10", 
"typings": "^1.0.4", 


And then KUDU will run
npm install
when you run the command
git push azure main


And it will be groooooooovy!
Reply all
Reply to author
Forward
0 new messages