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: Oldest
-
Dave Gray 581 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 511 Reputation points
2022-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/