public ApplicationInsightsLoggerTests()
        {
            _functionCategoryName = LogCategories.CreateFunctionUserCategory(_functionShortName);
            _endTime   = _startTime.AddMilliseconds(_durationMs);
            _arguments = new Dictionary <string, string>
            {
                ["queueMessage"] = "my message",
                ["anotherParam"] = "some value"
            };

            TelemetryConfiguration config = new TelemetryConfiguration
            {
                TelemetryChannel   = _channel,
                InstrumentationKey = "some key"
            };

            // Add the same initializers that we use in the product code
            DefaultTelemetryClientFactory.AddInitializers(config);

            _client = new TelemetryClient(config);

            var descriptor = new FunctionDescriptor
            {
                FullName  = _functionFullName,
                ShortName = _functionShortName
            };

            _functionInstance = new FunctionInstance(_invocationId, null, ExecutionReason.AutomaticTrigger, null, null, descriptor);
        }
Exemple #2
0
        public ApplicationInsightsLoggerTests()
        {
            _endTime   = _startTime.AddMilliseconds(durationMs);
            _arguments = new Dictionary <string, string>
            {
                ["queueMessage"] = "my message",
                ["anotherParam"] = "some value"
            };

            TelemetryConfiguration config = new TelemetryConfiguration
            {
                TelemetryChannel   = _channel,
                InstrumentationKey = "some key"
            };

            // Add the same initializers that we use in the product code
            DefaultTelemetryClientFactory.AddInitializers(config);

            _client = new TelemetryClient(config);
        }