A website is an application container in Windows Azure for running your code. The way it works is you create a website and then deploy your application to it. Windows Azure then takes care of hosting your app in the cloud, allowing it to scale, etc.
Azure Websites have some really nice benefits for node development
- Cheap - 10 free sites out of the box
- Fast - Deploy really quickly using git, github, mercurial, dropbox or FTP!
- Scalable - Easily scale up number of instances and underlying hardware
- Great for node
- Fully supports hosting node apps
- Downloads npm packages on the fly
- Streaming of node output logs
- Debugging support
npm install express -g
expressazure site create *site* --gitThis automatically provisions a new Website and creates a local git repo
git add .
git commit -am "first commit"
git push azure masterazure site browseGo update one of the files like the index.jade file
git commit -am "another update"
git push azure master
azure site browseazure site listazure site delete [site]azure site show [site]Create a site that is connecting to a github repo
azure site create *site* --githubThis will create a website that is linked to a github repo. Every time you push to github the site will be updated.
- Edit your iisnode.yml and set "koggingEnabled" and "devErrorsEnabled" to true.
- Make an error in your code like requiring a module that does not exist.
git commit -am "setting debug"
git push azure master
azure site browseazure site log tailazure site deployment listazure site deployment redeploy *deployment_id*You can use the CLI to set environment variables which instantly propagate to your app. Very useful for staging / production like settings which you don't want hard coded.
Make a change in your index.jade to display a "foo" environment variable i.e.
#{process.env.foo}git commit -am "adding env"
git push azure masterazure site config add foo=barazure site browse