title: Application insights not working with startup DI in Azure Functions
body: <p>I am trying to log the message from the the Configure class to Application Insights. While the messages are properly logged inside the Run method, but where am adding the polly, Its not sending the message to Appinsights.</p>
  
  <p>//am able to log the message from here.</p>
  
  <pre><code>[FunctionName("Function1")]
  public async Task Run(string msg,
              ILogger log)
          {
              log.LogInformation("An error occurred.");
  }
  </code></pre>
  
  <p>// But not from here.</p>
  
  <pre><code>[assembly: FunctionsStartup(typeof(Startup))]
  namespace TestFunc2
  {
      public class Startup : FunctionsStartup
      {
          public override void Configure(IFunctionsHostBuilder builder)
          {
              builder.Services.HTTPExtension();
          }
      }
  
  public static class DependencyExtension
  {
      public static IServiceCollection HTTPExtension(this IServiceCollection services)
      {
          services.AddHttpClient&lt;Function1&gt;("client", (provider, client) =&gt;
          {
              var logger = provider.GetService&lt;ILogger&lt;Function1&gt;&gt;();
              logger.LogInformation("func2");
              logger.LogError("func2");
              client.BaseAddress = new Uri("http://www.ggl.com");
              client.DefaultRequestHeaders.Add("Accept", "application/json");
          });
  
          return services;
  
      }
  }
  
  }
  </code></pre>