Skip to content

Instantly share code, notes, and snippets.

public interface IApplicationSettings
{
string Get(string key);
string Get(string key, string defaultValue);
}
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"SuperApiKey": "VERY_SECRET_SECURE",
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
},
"ConnectionStrings": {
"SqlConnectionString": "MyConnectionString"
}
@aranm
aranm / ApplicationSettings.cs
Last active August 6, 2019 06:20
Application Settings and Connection Strings POCO
public class ApplicationSettings
{
public string AzureWebJobsStorage { get; set; }
public string SuperApiKey { get; set; }
}
public class ConnectionStrings
{
public string SqlConnectionString { get; set; }
}
[assembly: FunctionsStartup(typeof(Startup))]
namespace MyFunctionsProject
{
public class Startup : FunctionsStartup
{
public override void Configure(IFunctionsHostBuilder builder)
{
// this will bind to the "Values" section of the configuration
builder
.Services