put it together with other app settings under Values: Load Connection String from Config File in Azure Functions.
Questions on Azure functions and Visual Studio / C#

Hi,
First set of Azure function apps so please bear with. :-)
Is it correct to add my SQL database connection string in the Azure function app configuration for production and in local.settings.json for my development/debugging?
If so then is this the correct format in that file?
How do I read this value and also my other values (Limit, offset etc) which used to be <appSettings> in the original Console app?
How do I read these in my C# code? I have read that I need to use Environment.GetEnvironmentVariable, however this returns null
string pagerduty = Environment.GetEnvironmentVariable("PagerDuty");
log.LogInformation(pagerduty);
Is there a way to keep the function app configuration (in portal) and the local settings in sync?
At present I only have two Azure functions in my project which is defined as the startup project. I have set a breakpoint in each
but only the first function (alphabetically) is hit, how can I test the second function (GetTeams)?
Here are some screenshots that will help explain better.
Thanks
-
2 additional answers
Sort by: Most helpful
-
Dave Gray 516 Reputation points
2022-01-05T17:51:41.357+00:00 Does anyone know the answer to this
At present I only have two Azure functions in my project which is defined as the startup project. I have set a breakpoint in each
but only the first function (alphabetically) is hit, how can I test the second function (GetTeams)?Thanks
Lohith GN 501 Reputation points2022-01-11T09:27:44.413+00:00 Hi. I created a video which explains how to read application settings in your function app. Do have a look at the video here: https://dotnetrumbles.wordpress.com/2022/01/11/reading-application-settings-in-azure-function-application/
-
Hi,
It's a timer trigger function app, created in VS2022 (preview). I'm not sure as to the "process" question, there was nothing in the
wizard options unless I missed it. How would I check?
Thanks