function initialize()

in src/utils/logic-app/monitoringViewUtils.ts [337:517]


                    function initialize(options, analyticsContextData) {
                        const iseSupported = !!options.featureFlags && !!options.featureFlags.enableintegrationserviceenvironment;

                        const config = {
                            apiOperationsPath: \`/providers/Microsoft.Web/locations/\${options.location}/apiOperations\`,
                            connectionsPath: "/providers/Microsoft.Web/connections",
                            connectionProvidersPath: \`/providers/Microsoft.Web/locations/\${options.location}/managedApis\`,
                            flowsPath: "/providers/Microsoft.Logic/workflows"
                        };

                        const urlService = new designercore.LogicAppsUrlService({
                            baseUrl: options.baseUrl,
                            config,
                            subscriptionId: options.subscriptionId,
                            resourceGroup: options.resourceGroup,
                            location: options.location,
                            integrationAccountId: options.integrationAccountId
                        });

                        const apiManagementServiceFactory = analytics => {
                            return new designercore.LogicAppsApiManagementService({
                                analytics,
                                apiVersion: options.apiManagementApiVersion,
                                baseUrl: options.baseUrl,
                                getAccessToken: getArmAccessToken,
                                locale: $locale,
                                subscriptionId: options.subscriptionId
                            });
                        };

                        const hostServiceFactory = () => ({
                        });

                        const runInstanceServiceFactory = analytics => {
                            return new designercore.LogicAppsRunInstanceService({
                                analytics,
                                apiVersion: options.emaApiVersion,
                                baseUrl: options.baseUrl,
                                getAccessToken: getArmAccessToken,
                                locale: $locale
                            });
                        };

                        const connectionServiceFactory = analytics => {
                            return new designercore.LogicAppsConnectionService({
                                analytics,
                                apiVersion: options.connectionApiVersion,
                                apiVersionForConnection: iseSupported ? options.integrationServiceEnvironmentApiVersion : options.connectionApiVersion,
                                apiVersionForCustomConnector: iseSupported ? options.integrationServiceEnvironmentApiVersion : options.connectionApiVersion,
                                apiVersionForGateways: options.connectionApiVersion,
                                apiVersionForIseManagedConnector: iseSupported ? options.integrationServiceEnvironmentApiVersion : options.connectionApiVersion,
                                apiVersionForSharedManagedConnector: iseSupported ? options.integrationServiceEnvironmentApiVersion : options.connectionApiVersion,
                                baseUrl: options.baseUrl,
                                batchApiVersion: options.batchApiVersion,
                                getAccessToken: getArmAccessToken,
                                integrationServiceEnvironmentId: options.integrationServiceEnvironmentId,
                                isIntegrationServiceEnvironmentSupported: iseSupported,
                                locale: $locale,
                                oauthService,
                                urlService
                            });
                        };

                        const getArmAccessToken = async () => {
                            return "${authorization}".substring("Bearer ".length);
                        };

                        const analyticsServiceFactory = version => {
                            const telemetryBaseUrl = options.telemetryBaseUrl || options.baseUrl;
                            const telemetryVersion = options.telemetryVersion || options.emaApiVersion;
                            const settings = {
                                analyticsServiceUri: \`\${telemetryBaseUrl}/providers/Internal.Telemetry/collect?api-version=\${telemetryVersion}\`,
                                getAccessToken: getArmAccessToken
                            };

                            const contextData = analyticsContextData || {};
                            contextData.host = window.location.host;
                            contextData.hostVersion = options.extensionVersion;
                            contextData.designerVersion = version;

                            const analyticsService = new designercore.AnalyticsService(settings, contextData);
                            analyticsService.startPublish();

                            return analyticsService;
                        };

                        const builtInTypeServiceFactory = (analytics, schemaVersion) => {
                            const options = {
                                openApiConnection: false,
                                showScopeActions: true,
                                showVariableActions: true,
                                httpManagedServiceIdentitySupported: true
                            };

                            return new designercore.LogicAppsBuiltInTypeService(schemaVersion, options);
                        };

                        const functionServiceFactory = analytics => {
                            return new designercore.LogicAppsFunctionService({
                                analytics,
                                apiVersion: options.azureFunctionApiVersion,
                                baseUrl: options.baseUrl,
                                getAccessToken: getArmAccessToken,
                                locale: $locale,
                                urlService
                            });
                        };

                        const operationManifestServiceFactory = () => {
                            return new designercore.LogicAppsOperationManifestService();
                        };

                        const runServiceFactory = analytics => {
                            return new designercore.LogicAppsRunService({
                                analytics,
                                apiVersion: options.emaApiVersion,
                                baseUrl: options.baseUrl,
                                getAccessToken: getArmAccessToken,
                                getRuntimeToken: getArmAccessToken,
                                locale: $locale
                            });
                        };

                        const workflowServiceFactory = analytics => {
                            return new designercore.LogicAppsWorkflowService({
                                analytics,
                                apiVersion: options.emaApiVersion,
                                baseUrl: options.baseUrl,
                                getAccessToken: getArmAccessToken,
                                locale: $locale,
                                urlService
                            });
                        };

                        flowConfigurationOptions = {
                            analyticsServiceFactory,
                            apiManagementServiceFactory,
                            apiVersion: options.emaApiVersion,
                            azureFunctionsApiVersion: options.azureFunctionApiVersion,
                            baseUrl: options.baseUrl,
                            batchApiVersion: options.batchApiVersion,
                            builtInTypeServiceFactory,
                            connectionGatewayApiVersion: options.connectionGatewayApiVersion,
                            connectionServiceFactory,
                            dynamicCallApiVersion: options.connectionApiVersion,
                            features: {
                                COLORIZE_MONITORING_INPUTS_OUTPUTS: true,
                                DEBOUNCE_EMIT_CHANGE: true,
                                ENABLE_ENVIRONMENT_BADGE: false, // TODO(joechung): Enable when ISE is supported in Visual Studio Code.
                                EXPRESSION_TRACE: true,
                                FX_TOKEN: true,
                                FX_TOKEN_FOR_CONDITION: true,
                                HIDE_PANEL_MODE_UI: true,
                                LOAD_RUN_ACTION_INPUTS_OUTPUTS_ASYNC: true,
                                SHOW_WEBHOOK_REQUEST_HISTORY: true,
                                SUPPORT_OBFUSCATION: true,
                                SUPPORT_PAN_AND_ZOOM: ${!canvasMode},
                                SUPPORT_PANEL_MODE: ${canvasMode},
                                USE_NEW_EXPRESSION_PARSER: true
                            },
                            functionServiceFactory,
                            getArmAccessToken: getArmAccessToken,
                            getRuntimeAccessToken: getArmAccessToken,
                            host: window.location.host,
                            hostEnvironment: designercore.Host.LogicApps,
                            hostServiceFactory,
                            hostVersion: options.extensionVersion,
                            identifier: "",
                            oauthService,
                            operationManifestServiceFactory,
                            runInstanceServiceFactory,
                            runServiceFactory,
                            startTelemetryPublish: true,
                            telemetryBaseUrl: options.telemetryBaseUrl,
                            telemetryVersion: options.telemetryVersion,
                            urlService,
                            workflowServiceFactory
                        };

                        monitor = window.monitor = new designercore.Monitor(flowConfigurationOptions, element);
                    }