douyan2002 2016-10-19 17:17
浏览 41
已采纳

关于Azure中的WebJobs:需要持续执行PHP代码

I'm quite new to the Azure interface, but I have been working with PHP for a while.

I have been asked to make a routine that executes every some time at background, whose objective is to send some marketing mail. And I have been reading about WebJobs. I can't quite get the grasp of it, though.

For me the documentation is a bit overwhelming, to say at least. So what I want to do is understand how WebJobs work and use them to execute PHP code every some time, without needing user input.

As I have said before, I have never used Azure before and have been never asked to do such things on PHP either, at least not this complex.

  • 写回答

1条回答 默认 最新

  • douyousu9691 2016-10-19 17:38
    关注

    There is a walkthrough of how to create a webjob on the azure docs - php is supported in webjobs. Webjobs are essentially a means for App Services to run a non-interactive process on a triggered or continuous basis. You don't have to use PHP, you can run another .exe if you like. Personally I write code in c# using the webjobs SDK and deploy those, they ease the way in which triggers, inputs and outputs are passed to/from your webjob via a nice simple binding process.

    Theres a more detailed explanation here. Webjobs are hosted in your app service plan, which you can look at as a container for resources used to run and host your web sites, web apis, and web jobs.

    Last copuple of things to say are 1 - that via the portal you can see the status of all your webjobs, when they triggered, what the console output was, if they succeeded or failed, etc. and 2 - Azure Functions do the same thing but in a different way - they use the webjobs api but present as a "serverless" experience instead (ie. no app service required). So if you don't want to be concerned with a web site or managing the scaling yourself, see Functions documentation

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 matlab计算中误差
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊