mucle6
mucle6

Reputation: 655

How to share config files between webjobs in azure

I currently have 7 webjobs that all connect to the same database with the same credentials. I want to have one file that all of the webjobs include so I don't have to make changes about username/password/host 7 times.

I've tried having the file be in the parent directory to all of the webjobs, but it appears that when a webjob is triggerd it's put in to a sandbox in a different directory.

This is the path my program prints out when running D:\local\Temp\jobs\triggered, but this is the directory that I put my webjobs in via ftp /site/wwwroot/App_Data/jobs/triggered

Is there a way that I can load the same file in all of my webjobs without having 7 instances of that file?

Upvotes: 1

Views: 269

Answers (1)

David Ebbo
David Ebbo

Reputation: 43183

The simplest way is to set an App Setting (or Connection String) in the Azure Portal (or equivalently via the Azure ARM API). When you do that, the setting will be available to all your WebJobs.

Upvotes: 1

Related Questions