How do I allow my WebJob access to SQL databases running on Azure VMs?

David Downing 701 Reputation points
2021-03-29T18:00:16.063+00:00

I am developing several Azure WebJobs that need to read SQL databases that are running on Azure VMs.

Can I specify the credentials used when running the WebJob? If not, what is the recommended approach? My goal is to be able to use a SQL connection string in my console app that doesn't contain user id/password.

Thank you.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,944 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 16,191 Reputation points
    2021-03-30T23:51:00.477+00:00

    Hi @David Downing ,

    Currently, the WebJobs SDK only supports Azure Storage (tables, blobs, queues ). It does not support SQL databases as triggers. However, you can run SQL Azure in your executable code within the webjob itself. Please view this workaround in this related SO thread.

    Hope that helps. Let us know if you have further questions.

    Thanks,
    Grace