Q:

MongoError: server sockets closed in Azure Web App

So I've deployed my express/mongodb app via git to my Azure Web App, and when I open the app's link it keeps loading and shows a black page, my routes doesn't work, but the static files load just fine.
So I went to see the log, and I got this.    
D:\home\site\wwwroot\node_modules\mongodb\lib\server.js:236
        process.nextTick(function() { throw err; })
                                      ^
MongoError: server 127.0.0.1:3000 sockets closed
    at null.<anonymous> (D:\home\site\wwwroot\node_modules\mongodb-core\lib\topologies\server.js:330:47)
    at g (events.js:260:16)
    at emitTwo (events.js:87:13)
    at emit (events.js:172:7)
    at null.<anonymous> (D:\home\site\wwwroot\node_modules\mongodb-core\lib\connection\pool.js:105:12)
    at g (events.js:260:16)
    at emitTwo (events.js:87:13)
    at emit (events.js:172:7)
    at Socket.<anonymous> (D:\home\site\wwwroot\node_modules\mongodb-core\lib\connection\connection.js:145:12)
    at Socket.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at TCP._onclose (net.js:469:12)

npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\4.2.3\\node.exe" "D:\\Program Files (x86)\\npm\\3.5.1\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v4.2.3
npm ERR! npm  v3.5.1
npm ERR! code ELIFECYCLE
npm ERR! cinemat_iq@0.9.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the cinemat_iq@0.9.0 start script 'node ./bin/www'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the cinemat_iq package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/www
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs cinemat_iq
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls cinemat_iq
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\home\site\wwwroot\npm-debug.log

So the issues appears to be in mongodb's connection command, which I currently have it as
mongoose.connect('mongodb://127.0.0.1:3000/myapp');

I've tried changing to localhost instead of 127.0.0.1, and tried a different port, all resulted the same error.
After some googling/stackoverflowing, it appears that there's a 'lock file' in mongodb that I need to remove, then repair/restart the mongodb service.
The problem is that I can't find this file using Azure Console (which is Windows based), and I couldn't run any mongo or mongod command (it is not recognized as an internal or external command).
So what can I do to get my app to work on Azure? 

A:

As I know, there are not any databases supplied directly on Azure WebApps. So the issue was caused by no mongodb instance on the address localhost or 127.0.0.1 of your webapp, not the MongoDB connection string incorrect.
You can try to create an instance of MongoDB on Azure, and copy the connection string to change the code mongoose.connect('<the remote connection string>').
As reference, you can refer to the doc Announcing New MongoDB Instances on Microsoft Azure to know MongoDB on Azure and how to get started.

