I have an MVC website that publishes in Azure, where it uses an Azure SQL database.
The time has come when we need to run a scheduled task to send SMS reminders. I got the impression that Azure Web Jobs is great for this, but I am having problems starting up.
I have added a console application to my website and reference the EF data model from the console application (which I would like to publish as a web job).
The current console application is as follows:
class Program { static void Main(string[] args) { JobHost host = new JobHost(); host.RunAndBlock(); } public static void ProcessNotifications() { var uow = new KirkleesDatabase.DAL.UnitOfWork(); uow.CommunicationRepository.SendPALSAppointmentReminders(); } }
Running the console application then throws an exception:
Additional Information: The user account connection string is missing. This can be set via the AzureJobsData connection string or through the constructor.
This indicates that the web job is specifically looking for a connection string pointing to the storage account. However, I would like the web job to query the Azure database and not work with the repository.
Is this doable?
Thanks,
azure azure-webjobs
Sergio
source share