Exemple #1
0
 public void Initialize(ITelemetry telemetry)
 {
     telemetry.Context.Operation.Name                    = CorrelationManager.GetOperationName();
     telemetry.Context.Operation.ParentId                = CorrelationManager.GetOperationParentId();
     telemetry.Context.Operation.Id                      = CorrelationManager.GetOperationId();
     telemetry.Context.Properties["StartTrace"]          = CorrelationManager.GetStartTrace();
     telemetry.Context.Properties["StopTrace"]           = CorrelationManager.GetStopTrace();
     telemetry.Context.Properties[this.sourceBatchIdKey] = CorrelationManager.GetSourceBatchId();
 }
        // Puts a serialized fixit onto the queue.
        public async Task SendMessageAsync(FixItTask fixIt)
        {
            CloudQueue queue = queueClient.GetQueueReference(FixitQueueName);
            await queue.CreateIfNotExistsAsync();

            var fixitJson = JsonConvert.SerializeObject(new FixItTaskMessage
            {
                Task        = fixIt,
                OperationId = CorrelationManager.GetOperationId()
            });
            CloudQueueMessage message = new CloudQueueMessage(fixitJson);

            await queue.AddMessageAsync(message);
        }
        public void CreateValue(string value)
        {
            var storageAccount = CloudStorageAccount.Parse(AzureStorageConfiguration.Value.QueueConnectionString);
            var queueClient    = storageAccount.CreateCloudQueueClient();
            var queue          = queueClient.GetQueueReference(AzureStorageConfiguration.Value.QueueName);

            queue.CreateIfNotExists();

            var message = new CloudQueueMessage(JsonConvert.SerializeObject(new ValueMessage
            {
                OperationId = CorrelationManager.GetOperationId(),
                Value       = value
            }));

            queue.AddMessage(message);
        }
 public void Initialize(ITelemetry telemetry)
 {
     telemetry.Context.Operation.Id = CorrelationManager.GetOperationId();
 }