0

I've hosted my website on azure and now I want to schedule payments on a monthly basis. I am using Authorize.net for payments but I cannot use their recurring billing feature as it gives very little control. I've to perform checks in the database, make payments and update records. What should I use Azure Scheduler, Azure WebJob or Azure Functions a Worker Role?

2 Answers2

2

Definitely not a Worker Role. They are very heavyweight and generally not worth the effort for a single, simple job like this.

Web jobs might be a good solution. It can run in the context of your web app, so you can use this with no additional cost. But you'll need to do some development with this - you have to create an app that calls Authorize.net.

If you only need to fire a single HTTP request, then using Azure Scheduler to schedule this HTTP action might be a good choice. You can configure the request itself (headers, payload) and it has error handling as well. But you might have to store sensitive information in the Azure portal, in the configuration of the scheduled job.

So I'd say forget about the Worker Role, then weigh simplicity against flexibility and development effort. That being sad, I would probably try it with the scheduler, and then move on to the WebJob, if I encounter something that is not feasible with the scheduler.

Edit:

Azure Functions can also be a good option - I'd say it's sort of a middle ground between the webjob and the simple scheduled option. It is part of the app services featureset, so it can run in the same appservice plan as the web app, so no costs. But here you have to code the http request to Authorize.net yourself as well. But Azure Functions is a lot more lightweight compared to webjobs - you do not have to create an exe (or ps script or whatever), you can just code the http request in a script editor inside the Azure portal. But you still have to do it yourself. This is a bit more flexible than the simple scheduled option though, which is something to consider when it comes to error handling.

So this is a good middleground, but I think it's still a lot of work given the complexity of the task (which is to fire a single HTTP request).

Akos Nagy
  • 4,201
  • 1
  • 20
  • 37
  • Would you mind adding Azure Functions in the mix as well? – Gaurav Mantri May 04 '17 at 11:32
  • @GauravMantri edited the post to include Azure Functions – Akos Nagy May 04 '17 at 11:47
  • Thanks! +1 for that :). I have been reading about Functions and it looks really nice option to execute background tasks. – Gaurav Mantri May 04 '17 at 11:53
  • FYI, with Azure Functions, if you are using the Consumption Plan (pay per usage), then your Function execution needs to be time-boxed to 20 mins. Any Function App process that runs longer than that will be terminated. If you chose the App Service Plan, then you can have long running Azure Functions by turning on the AlwaysOn feature. – Ling Toh May 04 '17 at 22:32
  • Sorry, I need to make a correction, the timebox is 5 mins, not 20. – Ling Toh May 05 '17 at 21:42
1

To get it working quickly, Logic Apps is a good choice. With Logic Apps, you can trigger it with a timer based on schedule you defined, use the out-of-box SQL/DocDB (depending on your exact scenario) to connect to your database. Although there's currently no Authorize.net connector available, you should be able to use the generic HTTP action to talk to its RESTful APIs. Most likely, you should be able to get this working very quickly. I'd also recommend submit a suggestion on aka.ms/logicapps-wish so we can track the request for Authorize.net connector, when available, is going to make this ever easier.

Derek Li
  • 3,089
  • 2
  • 25
  • 38