How to use Azure App Insights in .Net Core without connectionstring

d-ms-22 0 Reputation points
2023-03-16T13:45:13.71+00:00

We have a .Net Core project using Azure Applicaiton Insights. The project is configurated to access App Insights via Managed Identity. Below article shows connectionstring is still needed even DefaultAzureCredential is used. And our tests confirmed this. Is there a way to use Managed Identity to access App Insights without connectionstring? Thank you.

https://learn.microsoft.com/en-us/azure/azure-monitor/app/azure-ad-authentication

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,645 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 19,151 Reputation points Moderator
    2023-03-31T02:33:08.41+00:00

    Hi @d-ms-22 thanks for the question.

    The short answer is no. Currently there is no way to use Managed Identity to access App Insights without connectionstring

    According to the documentation you shared, after the Azure AD authentication is enabled, you can choose to disable local authentication. This configuration will allow you to ingest telemetry authenticated exclusively by Azure AD and impacts data access (for example, through API Keys). You can disable local authentication by using the Azure portal, Azure Policy, or programmatically. Once your resource has disabled local authentication, you'll see the corresponding info in the Overview pane but the connectionstring is still required to configure the Application Insights SDK in your .NET Core project

    hope that helps.

    -Grace

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.