I have an azure function app that is failing to run. I seem to have fallen into Versioning Hell with application insights.
On the Function App page it displays the error:
Microsoft.Azure.WebJobs.Extensions.ApplicationInsights: Could not load file or assembly 'Microsoft.Azure.WebJobs.Logging.ApplicationInsights, Version=3.0.27.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
This function app contains one function. I include the following packages:
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ApplicationInsights" Version="1.0.0-preview4" />
<PackageReference Include="Microsoft.Azure.WebJobs.Logging.ApplicationInsights" Version="3.0.27.0" />
I have tried removing the keys APPINSIGHTS_INSTRUMENTATIONKEY and APPLICATIONINSIGHTS_CONNECTION_STRING. Now I get a different error:
Microsoft.Azure.WebJobs.Script: The Application Insights Extension is installed but is not properly configured. Please define the "APPLICATIONINSIGHTS_CONNECTION_STRING" app setting.
What do I have to do to get my Azure Function app to start running?
I than attempted to create a whole new function app and got the following error:
Microsoft.Azure.WebJobs.Extensions.ApplicationInsights: Method not found: 'Void Microsoft.Azure.WebJobs.Logging.ApplicationInsights.ApplicationInsightsLoggerOptions.set_SamplingSettings(Microsoft.ApplicationInsights.WindowsServer.Channel.Implementation.SamplingPercentageEstimatorSettings)'.
I have an unsatisfactory answer, but I'll add what I learnt for the next person who is fumbling around with this:
Microsoft.Azure.WebJobs.Extensions.ApplicationInsights
nor Microsoft.Azure.WebJobs.Logging.ApplicationInsights
)Once I set the runtime version to ~3 and removed the application insights package, I had a working Azure function.