Azure WebApps NodeJS - A frustrating day of black boxes
Today I have been trying to use Azure to deploy a NodeJS application to an Azure WebApp with frustrations.
I am no NodeJS hipster and have just started/stumbled into NodeJS development but feel that today has been a hard day for me to achieve something.
I have written a NodeJS GitHub app using GitHub's Probot tool which also helps scaffold the necessary parts - https://probot.github.io/docs/
Brilliant I have hacked my way to something that works locally & now I would like to deploy it. Working at a Microsoft house where we use Azure, I thought it would be best to deploy the GitHub Bot/App to a NodeJS Azure WebApp, as it is mostly a basic NodeJS app that is listening from WebHook payloads from GitHub.
So I thought OK, this should be relatively trivial to deploy something like this, but unfortunately I have struggled today :(
Appologies in advice as this is just a massive dump of my brain from today.
Here are my initial thoughts & frustrations:
The docs for deploying a NodeJS app/site here - https://docs.microsoft.com/en-us/azure/app-service/app-service-web-get-started-nodejs make it seem super trivial to do. Create a ZIP of the folder/app that is running locally & use the KUDU ZIP Upload UI tool & voilia it just works!
After my application was not running or working. I found the example GitHub link of the application includes a web.config which I found to be unusual and obviously recognise from my more comfortable background of developing websites & applications in C# & .NET
The documentation does mention this but in my opinion glosses over how this works and how it is all plumbed together as this seems a key/criticial thing for me to get right.
If I was a native NodeJS developer and had no background of C# & .NET then this file would be a massive confusion.
So I end up proding & poking the web.config in order to get something to respond but have no luck.
Frustrated I was tempted to deploy to Heroku or Now.sh as mentioned in the GitHub Probot docs, but I was determined not to give up on Azure just yet.
My next train of thought was to create a new Azure WebApp and use the local git repository that is backed by KUDU and to push my application directly and let KUDU do it's magic & see what the very verose git push logs report back when KUDU is doing its deployment thing.
After a chat with a colleague he pointed me to the KUDU deployment script repo here - https://github.com/projectkudu/kudu-deployment-scripts/blob/master/scripts/deploy-hubot.cmd again none of this is documented and easy to know about if I was just a NodeJS dev wanting to deploy/push something out.
Again I was hacking away in order to try and get something to work but it seems like I am unable to have my application be booted & run from
npm run start and need a server.js or app.js file according to the feedbasck from the git push logs.
Is there anyway to get some insight or logs into what is happening and how to debug booting up & creating a NodeJS application that will run on Azure. As I seem to be struggling with the black box of IISNode web.config & KUDU deployment scripts.
I would really love if someone is able to help me get my little ProBot application deployed & alive please and not use another service such as Heroku.