title: How to get app insights working on an azure webjob with .net core 2.x?
body: <p>I have a webjob with .net core 2.1</p>
  <p>I have an instrumentation key on the appsettings.json.</p>
  <p>and I have this on the method ConfigureServices in program.cs</p>
  <pre><code>        services.AddApplicationInsightsTelemetry();
  </code></pre>
  <p>However, I get this error when the app starts</p>
  <pre><code>System.InvalidOperationException: 'Unable to resolve service for type 'Microsoft.AspNetCore.Hosting.IHostingEnvironment' while attempting to activate 'Microsoft.AspNetCore.Hosting.DefaultApplicationInsightsServiceConfigureOptions'.'
  </code></pre>
  <p>I havent been able to find any documentation that can help me with this</p>