Update:
Azure Function is based on Web App Sandbox, so it's env var is from Application Settings.
Have a look of Azure Function Basic of Web App Sandbox:
https://learn.microsoft.com/en-us/sandbox/functions-recipes/functions-basics
This is the way to access the env var:
https://learn.microsoft.com/en-us/sandbox/functions-recipes/environment-variables?tabs=csharp#accessing-environment-variables
This doc explains the local.settings.json is the app settings when azure function is running on local:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=windows%2Ccsharp%2Cbash#local-settings-file
And this explains azure function app settings is in Configuration on azure:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-how-to-use-azure-function-app-settings#settings
Original Answer:
Yes, it is ok.
Azure Function reads settings from local.settings.json on local and reads settings from Configuration settings on Azure, both of them will be read as env var.
So you can simply use
Environment.GetEnvironmentVariable("yoursettingskey");