How to define the cloud role name from a PowerShell script?
Hello!
I am using Application Insights to log events and exceptions that occur in a PowerShell script.
I need to define the cloud role name so a new node would be added in the application map..
I tried this but it doesn't work:
$appInsights.InstrumentationKey = $ConfigEnvironement.Settings.AppInsightsInstrumentationKey;
$appInsights.Context.Cloud.RoleInstance = "";
$appInsights.Context.Cloud.RoleName = "roleName";
There is no new node in the application map. Do I need to add a telemetry initializer like below?:
$appInsights.TelemetryConfiguration.TelemetryInitializers.Add(What to add here?);
I can't find any source of information regarding the cloud role name in PowerShell...
Thanks for your help!
1 answer
Sort by: Most helpful
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more