Skip to content

Instantly share code, notes, and snippets.

@KevinDJones
Created November 14, 2018 06:20
Show Gist options
  • Save KevinDJones/6eea660f44a0efae7c9d4f5ddc5e5a11 to your computer and use it in GitHub Desktop.
Save KevinDJones/6eea660f44a0efae7c9d4f5ddc5e5a11 to your computer and use it in GitHub Desktop.
[assembly: WebJobsStartup(typeof(Startup))]
namespace YOUR.NAMESPACE
{
internal class Startup : IWebJobsStartup
{
public void Configure(IWebJobsBuilder builder)
{
builder.AddDependencyInjection(ConfigureServices);
}
private void ConfigureServices(IServiceCollection services)
{
var client = new SendGridClient(Environment.GetEnvironmentVariable("SENDGRID_API_KEY"));
services.AddSingleton<ISendGridClient>(client);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment