question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to set cloud role to see the frontend as a component in application Map in azure portal

See original GitHub issue

I am using V2.0.0 of @microsoft/applicationinsights-react-js, @microsoft/applicationinsights-web in my react application and trying to set the cloud role for the web app, so that i can visualize the connections in Application map in Azure portal.

I’m trying to set cloud role in below manner `

        appInsights.addTelemetryInitializer(envelope => {
            envelope.tags["ai.cloud.role"] = "UI";
        });


      `

As per documentation (https://docs.microsoft.com/en-us/azure/azure-monitor/app/app-map#clientbrowser-side-javascript) we need to call addTelemetryInitializer function on appInsights.Context, but in the new version it is available under appInsights not under Context.

Please let us know how to set cloud role to see the value in Azure Application Map, documentation is so confusing and outdated.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
LeopoldLerchcommented, May 28, 2019

It is wrong in documentation. It is really an Array that is evaluated. It works for me like this:

appInsights.addTelemetryInitializer((envelope) => { if (!envelope.tags) { envelope.tags = []; } envelope.tags.push({ "ai.cloud.role": appInsights.config.appId }); });

0reactions
github-actions[bot]commented, Aug 18, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Application Map - Azure Monitor - Microsoft Learn
Application Map uses the cloud role name property to identify the components on the map. Follow this guidance to manually set or override...
Read more >
Setting Cloud Role Name in Application Insights
When a cloud role name is set, it will appear as a node in the Application Map. Here is an example showing a...
Read more >
Monitoring Applications using Application Insights
Exercise 1: Creating Instrumentation Key · Go to Azure Portal from here · Click on + New icon to create a new Application...
Read more >
How to monitor app performance with Azure ... - YouTube
In this video, learn how to use Azure Monitor Application Insights to monitor live and historical application performance, detect/diagnose ...
Read more >
VMware Horizon Cloud Service on Microsoft Azure ...
Note: The role must be assigned directly to the Horizon Cloud app registration's service principal. The use of a group-based assignment of a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found