Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aranm
Last active August 6, 2019 06:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aranm/f6aac2aa3f2a0708133caf61c7e5ed57 to your computer and use it in GitHub Desktop.
Save aranm/f6aac2aa3f2a0708133caf61c7e5ed57 to your computer and use it in GitHub Desktop.
Azure Functions with DI'd Application Settings
public class MyFunctions
{
private readonly IOptions<ApplicationSettings> _applicationSettingsOptions;
private readonly IOptions<ConnectionStrings> _connectionStringsOptions;
public MyFunctions(IOptions<ApplicationSettings> applicationSettingsOptions, IOptions<ConnectionStrings> connectionStringsOptions)
{
// the "Values" section of the configuration file
_applicationSettingsOptions = applicationSettingsOptions;
// the named section of the configuration file "ConnectionStrings"
_connectionStringsOptions = connectionStringsOptions;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment