Skip to content

Instantly share code, notes, and snippets.

@JamesRandall
Created August 6, 2018 16:45
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 JamesRandall/dbd37f40e08a50d9c4c082cfd22f00ba to your computer and use it in GitHub Desktop.
Save JamesRandall/dbd37f40e08a50d9c4c082cfd22f00ba to your computer and use it in GitHub Desktop.
Environment variable example
public class FunctionAppConfiguration : IFunctionAppConfiguration
{
public void Build(IFunctionHostBuilder builder)
{
builder
.Setup((serviceCollection, commandRegistry) =>
{
serviceCollection
.AddCosmosRepository(Environment.GetEnvironmentVariable("cosmosConnectionString", EnvironmentVariableTarget.Process));
// rest of registration
})
.Functions(...);
}
}
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"AzureWebJobsDashboard": "UseDevelopmentStorage=true",
"cosmosConnectionString": "a connection string"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment