Skip to content

Instantly share code, notes, and snippets.

@petmat
Created May 14, 2019 20:03
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 petmat/93e1b735c5c39a88c7fd41032693ddf9 to your computer and use it in GitHub Desktop.
Save petmat/93e1b735c5c39a88c7fd41032693ddf9 to your computer and use it in GitHub Desktop.
[assembly: FunctionsStartup(typeof(MyNamespace.Startup))]
namespace MyNamespace
{
public class Startup : FunctionsStartup
{
public override void Configure(IFunctionsHostBuilder builder)
{
builder.Services.AddHttpClient();
builder.Services.AddSingleton((s) => {
return new CosmosClient(Environment.GetEnvironmentVariable("COSMOSDB_CONNECTIONSTRING"));
});
builder.Services.AddSingleton<ILoggerProvider, MyLoggerProvider>();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment