How to log with Monitoring Metrics Publisher role
Description/Screenshot We are using Application insights to log from frontend and application insights is associated to resource group with Monitoring Metrics Publisher role assigned. Which requires an authentication to be called.
But from frontend we can only pass connection string property.
How to achieve application insights logging with Monitoring Metrics Publisher role assigned?
While searching I found suggestions to incorporate proxy server but is it the cleaner approach? https://learn.microsoft.com/en-us/answers/questions/2280070/application-insights-javascript-sdk-401-unauthoriz Steps to Reproduce
- OS/Browser: Any
- SDK Version [e.g. 22]: latest (3.3.8)
- How you initialized the SDK:
import { ApplicationInsights} from "@microsoft/applicationinsights-web";
const appInsights = new ApplicationInsights({ config: { connectionString: CONNECTION_STRING' } }); appInsights.loadAppInsights();
Expected behavior With Monitoring Metrics Publisher role application insights allowed to log
@MSNev any help on above request?
Nev is currently OOF. Based on https://azure.microsoft.com/en-us/updates?id=switch-to-azure-ad-authentication-for-application-insights-by-30-september-2025 and https://learn.microsoft.com/en-us/azure/azure-monitor/app/azure-ad-authentication?tabs=aspnetcore#unsupported-scenarios it seems that the proxy is the most straightforward way for the browser side currently
Well I'm back, another option (which is currently being documented by one of our Support people -- not ready yet) is to create and use an Azure APIM as the proxy (so you don't need to create your own) so you can "add" the authentication within the APIM configuration
thank you for the suggestions @MSNev , when will the official documentation will be available? or may be certain steps will help in proceeding on this?
It is now available Using Azure API Management as a proxy for Application Insights Telemetry