I have a .NET Framework v4.8.2 application integrated with application insights, utilizing the instrumentation key for directing requests to application insights. Nevertheless, I would like to move this over to Role-Based Access Control (RBAC) as illustrated here: https://learn.microsoft.com/en-us/azure/azure-monitor/app/resources-roles-access-control.
I would like to remove the use of the instrumentation key entirely within the application and instead adopt Azure Managed Identity (DefaultAzureCredential) with permissions using terraform to publish to application insights. Is this possible? if so, how would I go about doing this?
Currently I have an applicatinsightsconfig file with <InstrumentationKey>MyKey</InstrumentationKey>
that I would like to remove and replace with managed identity.
A few parts here:
regional ingestion
compared to global ingestion
(which is deprecated)].Properties
-> LOCAL AUTHENTICATION: Enabled (click to change)
-> Switch to Disabled
):Note, Instrumentation Key will continue to be a part of a Connection String but with AAD auth enabled (or more exactly with Local auth
disabled) it starts to act only as a resource identifier rather than key.