I was just messing around with Node.js Tools for Visual Studio and Azure and ran into a few gotchas while getting everything setup. Hopefully this helps you get going.
1. Install the Node.js Tools for Visual Studio
2. Create a new “Basic Express Application”
- Uncheck “Create directory for solution” – This will put the sln file in the same dir as the project file. If you don’t uncheck this then the “git sync” will push the website into a subfolder in Azure. Unchecking will put the site in the root, which where you want it.
- Check add to source control. This is so you are prompted to add a local git repo.
3. Click “Yes” to run npm install.
4. Choose “Git”
5. Hit F5 to ensure that the project runs. You should see this:
6. Back to VS, Team Explorer, Changes. Enter a commit message and click Commit
7. Go to the Azure web portal, Create a new site
8. Go to the Dashboard of that site and click “Set up deployment from source control” in the right rail and choose Local Git Repository
9. Copy your Git url
10. Back in VS, Go to Team Explorer, Unsynced Commits and enter the URL of your Azure website git repo and hit publish. It will prompt you for creds. Enter your FTP user creds for that site, not your Azure account creds.
You will see it deploying on the Azure portal
11. Hit your site URL. You might get this error.
I went into the FTP of the site and found the log file "Logging-errors.txt
Which had this error:
which means that npm didn’t install the “debug” module which is a dependency of “stylus”. I think the problem is related to this: http://stackoverflow.com/questions/18401606/npm-doesnt-install-module-dependencies. So, I added “debug” to my package.json file.
Committed those changes and sync’d.
And now the site works