locked
Scheduled jobs - server scripts in C# possible? RRS feed

  • Question

  • Well I've been looking for samples and guides on how to create and run scheduled jobs in mobile services. But they are using server scripts in javascript. I thought there was support for .NET? I have all this c# code in my WIndows Phone app that I want to move to Azure but I do not want to rewrite the logic in javascript. 

    Or is there a way to package the c# into some form of class library and call it from Node.js?

    Please advise

    Thank you


    • Edited by Sal_S Thursday, March 27, 2014 12:20 AM
    Thursday, March 27, 2014 12:07 AM

Answers

  • If you create your mobile service is using the .NET backend, then you can define schedule jobs (as well as your whole backend) using C#. To create a scheduled job in your service, you need to define a class which inherits from Microsoft.WindowsAzure.Mobile.Service.ScheduledJob and override the abstract "ExecuteAsync" method.

    If you create a .NET backend mobile service and download the starter project in the quickstart page, you'll see an example of such a scheduled task.


    Carlos Figueira

    Thursday, March 27, 2014 2:06 PM

All replies

  • If you create your mobile service is using the .NET backend, then you can define schedule jobs (as well as your whole backend) using C#. To create a scheduled job in your service, you need to define a class which inherits from Microsoft.WindowsAzure.Mobile.Service.ScheduledJob and override the abstract "ExecuteAsync" method.

    If you create a .NET backend mobile service and download the starter project in the quickstart page, you'll see an example of such a scheduled task.


    Carlos Figueira

    Thursday, March 27, 2014 2:06 PM
  • I tried doing it but there's no script tab to add a script, what do I do?
    Friday, March 28, 2014 1:45 AM
  • as mentioned by Carlos, you can find a sample when you download the starter code for a .NET backend Mobile services
    Friday, March 28, 2014 1:27 PM