0

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 Answers1

1

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

Russell Young
  • 2,033
  • 1
  • 14
  • 12
  • What I want to achieve, is to execute **PHP** code code after certain amount of time, without having to enter to the page and without needing any kind of input. And I have read the documentation but I do not understand the WebJob exact functionality. – jorgehawkins Oct 19 '16 at 17:43
  • Yes Jorge, Webjobs do this - see my answer above :) – Russell Young Oct 19 '16 at 17:44
  • What specific problem are you having, the documentation I linked walks through it quite nicely, should be easy to follow? – Russell Young Oct 19 '16 at 17:45
  • OK. I'm reading that document you sent me. The steps are really easy to do. But for my inexperience with this system is basically giving a calculator to a toddler. So, what I have to do is create the Webjob through the Azure interface mentioned above and just add my PHP code to it? – jorgehawkins Oct 19 '16 at 17:52
  • Pretty much upload your code and configure the schedule - it is simpler to get started with azure Functions first, it sounds like that will fit your requirement - as I say it's the same under the covers, but you have less work to do and less to manage/configure. – Russell Young Oct 19 '16 at 17:58
  • OK. I think I got it. Thank you very much for your quick response. – jorgehawkins Oct 19 '16 at 18:05