You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
List of NuGet packages and version that you are using: Microsoft.ApplicationInsights.AspNetCore (v2.22.0), Azure.Identity (v1.12.0)
Runtime version (e.g. net461, net48, netcoreapp2.1, netcoreapp3.1, etc. You can find this information from the *.csproj file): net8.0
Hosting environment (e.g. Azure Web App, App Service on Linux, Windows, Ubuntu, etc.): Azure Web App, App Service on Linux, Windows via the .NET CLI locally
Describe the bug
If you disable local authentication for your AI resource, as it's recommended, then client-side tracking with /v2/track requests fail with HTTP 401 Unauthorized. This is after using SetAzureTokenCredential to configure a Service Principal, and using JavaScriptSnippet.FullScript.
Server-side tracking, as well as the Live Metrics control channel work (the latter is important because it shows the Service Principal working).
Enabling local authentication gets rid of this error.
I'd expect client-side tracking to work with local auth disabled too. The #2795 issue hints on this having been the case at one point.
To Reproduce
This is a minimal MVC web app, generated with the VS template:
You can reproduce the issue by configuring an AI connection string in the appsettings.json file, configuring a Service Principal's details in Program, and running the app.
For Immediate Support
For immediate support relating to the Application Insights .NET SDK we encourage you to file an Azure Support Request with Microsoft Azure instead of filing a GitHub Issue in this repository.
You can do so by going online to the Azure portal and submitting a support request. Access to subscription management and billing support is included with your Microsoft Azure subscription, and technical support is provided through one of the Azure Support Plans. For step-by-step guidance for the Azure portal, see How to create an Azure support request. Alternatively, you can create and manage your support tickets programmatically using the Azure Support ticket REST API
The text was updated successfully, but these errors were encountered:
*.csproj
file): net8.0Describe the bug
If you disable local authentication for your AI resource, as it's recommended, then client-side tracking with
/v2/track
requests fail with HTTP 401 Unauthorized. This is after usingSetAzureTokenCredential
to configure a Service Principal, and usingJavaScriptSnippet.FullScript
.Server-side tracking, as well as the Live Metrics control channel work (the latter is important because it shows the Service Principal working).
Enabling local authentication gets rid of this error.
I'd expect client-side tracking to work with local auth disabled too. The #2795 issue hints on this having been the case at one point.
To Reproduce
This is a minimal MVC web app, generated with the VS template:
WebApplication1.zip
You can reproduce the issue by configuring an AI connection string in the
appsettings.json
file, configuring a Service Principal's details inProgram
, and running the app.For Immediate Support
For immediate support relating to the Application Insights .NET SDK we encourage you to file an Azure Support Request with Microsoft Azure instead of filing a GitHub Issue in this repository.
You can do so by going online to the Azure portal and submitting a support request. Access to subscription management and billing support is included with your Microsoft Azure subscription, and technical support is provided through one of the Azure Support Plans. For step-by-step guidance for the Azure portal, see How to create an Azure support request. Alternatively, you can create and manage your support tickets programmatically using the Azure Support ticket REST API
The text was updated successfully, but these errors were encountered: