I am having several node js script files.I have to run these js files in azure web jobs.can any one tell me the detail step for how to add the node.js files in azure web jobs and also how to run these web jobs.
相关问题
- running headless chrome in an microsoft azure web
- Docker task in Azure devops won't accept "$(pw
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- google-drive can't get push notifications
- Register MicroServices in Azure Active Directory (
相关文章
- node连接远程oracle报错
- How can make folder with Firebase Cloud Functions
- @angular-cli install fails with deprecated request
- node.js modify file data stream?
- How to resolve hostname to an ip address in node j
- SQL Azure Reset autoincrement
- Transactionally writing files in Node.js
- Log to node console or debug during webpack build
Like the previous answers state, it's really as easy as adding .js files to your web job and following the instructions. The only thing that's particular about the process is that if you require any 3rd party modules in your Node script, then you have to zip up the .js files and the node_modules folder and deploy the whole thing - node_modules folder and all.
If you have a file with a .js extension it'll be run as a node program
Full documentation on Azure Web Jobs here: https://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-jobs/
It's relatively easy if you know some undocumented details :)
The key concept is ensuring correct application structure (for Azure). Your main application script should be named
run.js
, so in other words, your app should be able to start properly by executingnode run.js
command.What is more don't count on your
package.json
dependencies. From my own experience, I can tell thatpackage.json
dependencies sometimes work and sometimes not, so it is much safer to upload thenode_modules/
manually.You may add multiple app files by Zipping them and uploading inside Azure App > WebJob panel.
If your app has no bugs it should be running a few seconds after the upload.
For more info checkout this blog post.