-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WebToolsE2E][Aspire] Running with new Azure Function + Aspire, the error appears: "Application Insights SDK has not been added. Please add and configure the Application Insights SDK..." #6452
Comments
@mattchenderson Our CTI testing team ran into this issue as well. Any chance there's an issue on the Functions repo we can cross-link to? @v-bennettyue This is a known issue for now but let's use this to track eventually reverifying this scenario. |
Update: we think microsoft/ApplicationInsights-dotnet#2908 will resolve this. I'm trying to validate this now with a local build of those changes against the template. |
Chatted about this during triage. For this one we will need to get a new version of App Insights SDK to nuget and then for the Functions templates to use that version. |
Unfortunately, it looks like it'll take a while for the root cause that was referenced above to be resolved. For the time being, you can work around this problem by commenting out the following line in the builder.Services.ConfigureHttpClientDefaults(http =>
{
// Turn on resilience by default
- http.AddStandardResilienceHandler();
+ //http.AddStandardResilienceHandler();
// Turn on service discovery by default
http.AddServiceDiscovery();
}); This should help unblocking testing for related scenarios like #6297 and #6482. |
@balachir Correcting myself here. The Functions team has pushed an update to their templates in VS that comments out the problematic code. If you run this scenario again and ensure that you're using the latest version of the toolset, you shouldn't run into this issue anymore. You can verify the version of the Functions templates you are running on by opening the only file in the |
@captainsafia @balachir This issue not repro on .net 9.0 Azure Functions + Aspire, the latest version of the toolset is 4.101.0. |
Great! Glad the new updates resolve this issue. Can we close this out or did you notice other problems? |
There is no other issue, close this issue as fixed. |
I've just created a new FunctionApp project in the latest VS preview with ga .net9 and got the same error. If I comment out |
@mwiedemeyer This was resolved in the Functions templates by disabling the logic that brought in the Application insights SDK. When you go to your project file do you observe that package references associated with Application Insights are commented out in the default template? If they are not, your Visual Studio might be pulling an older version of the Azure Functions templates. Try restarting Visual Studio or searching for Azure Functions in your options panel and selection "Check for toolset update". |
Sorry, my bad. You are right. I've updated the functions tools from within VS and now the packages and startup code is commented. However, if I enable it, I have the same error. So what is the idea how to use it with app insights? |
@mwiedemeyer Yes, this is an unfortunate issue with the way the Application Insight SDK registers its dependencies. This bug is tracked on the Applicaton Insights SDK over at microsoft/ApplicationInsights-dotnet#2879. There's currently a PR open to resolve this in a future version of the SDK over at microsoft/ApplicationInsights-dotnet#2908. In the meantime, you can workaround this issue by temporarily disabling the |
INSTALL STEPS
REPRO STEPS
Note:
ACTUAL:
An error will occur:
Microsoft.Extensions.Options.OptionsValidationException: 'Application Insights SDK has not been added. Please add and configure the Application Insights SDK. See https://learn.microsoft.com/en-us/azure/azure-monitor/app/worker-service for more information.'
EXPECTED
Run successfully
The text was updated successfully, but these errors were encountered: