public async Task OpenLiveStreamInBrowser(Site functionApp, ArmSubscriptionsArray allSubscriptions) { if (!functionApp.AzureAppSettings.ContainsKey(ApplicationInsightsIKeySetting)) { throw new CliException($"Missing {ApplicationInsightsIKeySetting} App Setting. " + $"Please make sure you have Application Insights configured with you function app."); } var iKey = functionApp.AzureAppSettings[ApplicationInsightsIKeySetting]; if (string.IsNullOrEmpty(iKey)) { throw new CliException("Invalid Instrumentation Key found. Please make sure that the Application Insights is configured correctly."); } ColoredConsole.WriteLine("Retrieving Application Insights information..."); var appId = await AzureHelper.GetApplicationInsightIDFromIKey(iKey, AccessToken, ManagementURL, allSubs : allSubscriptions); var armResourceId = AzureHelper.ParseResourceId(appId); var componentId = $@"{{""Name"":""{armResourceId.Name}"",""SubscriptionId"":""{armResourceId.Subscription}"",""ResourceGroup"":""{armResourceId.ResourceGroup}""}}"; var liveMetricsUrl = string.Format(LiveMetricsUriTemplate, WebUtility.UrlEncode(componentId), WebUtility.UrlEncode(appId)); ColoredConsole.WriteLine("Launching web browser..."); if (StaticSettings.IsDebug) { ColoredConsole.WriteLine(VerboseColor($"Launching browser with URL- {liveMetricsUrl}")); } Utilities.OpenBrowser(liveMetricsUrl); }