locked
Using the WebJobs SDK outside of WebJobs RRS feed

  • Question

  • Hi,

    According to the documentation it is possible to use WebJobs SDK outside of WebJobs.

    Let's say you choose to go this path and host it on a classic VM and deploy it as a Windows Service.

    If we'd want to run it on a Schedulle, could we still use the CRON expression for that? Is there a built-in scheduler?

    Or (for example) we would have to deploy it as console app and use the windows task sched.?

    Cheers,

    Carlos


    Best Regards,
    Carlos Sardo

    Wednesday, June 15, 2016 9:59 AM

Answers

All replies

  • Yes, you can use Timer Triggers on WebJobs SDK functions, and this will work outside of WebJobs.

    David

    Wednesday, June 15, 2016 4:04 PM
  • Thank you!

    Best Regards,
    Carlos Sardo

    Monday, June 20, 2016 7:45 AM
  • When I try to run the Console App locally (using the WebJobs SDK) like this:

    class Program
        {
            static void Main(string[] args)
            {
                ServiceBusConfiguration serviceBusConfiguration = new ServiceBusConfiguration()
                {
                    ConnectionString = ConfigurationManager.ConnectionStrings["AzureWebJobsServiceBus"].ConnectionString,
                };
    
                JobHostConfiguration config = new JobHostConfiguration();
                config.DashboardConnectionString = "";
                config.StorageConnectionString = "";
                config.UseServiceBus(serviceBusConfiguration);
    
    
                JobHost host = new JobHost(config);
                host.RunAndBlock();
            }
    
            public static void ProcessQueueMessage([ServiceBusTrigger("inputqueue")] string message,
            TextWriter logger)
            {
                logger.WriteLine(message);
            }
        }

    I get an exception on the RunAndBlock(); "Microsoft Azure WebJobs SDK Storage connection string is missing or empty. The Microsoft Azure Storage account connection string can be set in the following ways".

    If I'd want use the WebJobs SDK (in this Console App) outside of Azure and also not make use of the Dashboard or the Storage... Would it be possible?


    Best Regards,
    Carlos Sardo


    Monday, June 20, 2016 8:26 AM
  • Yes, you just need to set those two appsettings to valid storage connection strings, as per the error message.
    Monday, June 20, 2016 3:04 PM
  • Yes, you just need to set those two appsettings to valid storage connection strings, as per the error message.

    Hi David,

    In my case I want to run the console app (with the WebJobs SDK) completly disconnected from Azure. According to this PR in Github, this should be possible. Right?

    Thanks!


    Best Regards,
    Carlos Sardo

    Tuesday, June 21, 2016 7:20 AM
  • I think the issue is that this change is only in the prerelase 2.x bits, which you can get from nuget feed https://www.myget.org/F/azure-appservice/api/v2. Can you give that a try?
    Tuesday, June 21, 2016 2:31 PM
  • I got the 2.0.0-alpha-10349 bits, altough I get an NullRefException in the RunAndBlock();

    Stack trace points to SingletonManager.GetLockDirectory(...)

    These are really fresh bits off course.

    I created a ticket in Github.


    Best Regards,
    Carlos Sardo

    Wednesday, June 22, 2016 1:18 PM