Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure webjobs not reading the site appsettings

I've got an azure webjob, that has some appsettings for api keys etc.

I've also got a bunch of PRODUCTION azure app settings (specified in the portal), that should override my webjob config appsettings.. But they don't.

For my website, they work as expected, and all is fine. For the webjobs however, they just get completely ignored, and my app settings from the config are used instead.

Is this a bug in azure? All the docs suggest that this should work.

EDIT

I found this blog all about using CloudConfigurationManager.GetSetting so I've implemented that and it still won't work - still using the settings that are defined in web job's app settings file :(

Thanks

like image 908
Matt Roberts Avatar asked Nov 17 '14 14:11

Matt Roberts


People also ask

Does APP service configuration override appSettings JSON?

When you add, remove, or edit app settings, App Service triggers an app restart. For ASP.NET and ASP.NET Core developers, setting app settings in App Service are like setting them in <appSettings> in Web. config or appsettings. json, but the values in App Service override the ones in Web.

What is azure WebJobs SDK?

The Azure WebJobs SDK is a framework that simplifies the task of writing background processing code that runs in Azure WebJobs. It includes a declarative binding and trigger system that works with Azure Storage Blobs, Queues and Tables as well as Service Bus.

Where are WebJobs in Azure portal?

In the Azure portal, search for and select App Services. Select your web app, API app, or mobile app from the list. In the left pane of your app's App Service page, select WebJobs.


1 Answers

So it looks like I've found a bug!

It's because my AppSettings were referenced from another file, like this (in app.config):

<AppSettings file="appsettings.config"/>

This basically breaks azure's config management.

like image 185
Matt Roberts Avatar answered Nov 02 '22 19:11

Matt Roberts