Repository: Azure/WALinuxAgent
Pull request #1918 (2020-06-24 00:56:05)

Extension telemetry pipeline
<!-- DO NOT DELETE THIS TEMPLATE -->

## Description
This PR contains the major changes for enabling Extension Telemetry pipeline for Extensions. 
It adds a new thread to the Agent which comes alive every 5 mins and reads the events directory per extension and sends those extensions to Wireserver.

Issue # <!-- if any -->
<!--
Please add an informative description that covers that changes made by the pull request. 
This checklist is used to make sure that common issues in a pull request are addressed.
This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
-->

---

### PR information
- [ ] The title of the PR is clear and informative.
- [ ] There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, [see this page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md).
- [ ] Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
- [ ] If applicable, the PR references the bug/issue that it fixes in the description.
- [ ] New Unit tests were added for the changes made and Travis.CI is passing.

### Quality of Code and Contribution Guidelines
- [ ] I have read the [contribution guidelines](https://github.com/Azure/WALinuxAgent/blob/master/.github/CONTRIBUTING.md).

codecov[bot]: # [Codecov](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918?src=pr&el=h1) Report
> Merging [#1918](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918?src=pr&el=desc) into [develop](https://codecov.io/gh/Azure/WALinuxAgent/commit/71654c4dec506d721042eaf3950471600ce4e392&el=desc) will **increase** coverage by `0.26%`.
> The diff coverage is `83.96%`.

[![Impacted file tree graph](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918/graphs/tree.svg?width=650&height=150&src=pr&token=ae90E2KYCw)](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918?src=pr&el=tree)

```diff
@@             Coverage Diff             @@
##           develop    #1918      +/-   ##
===========================================
+ Coverage    69.60%   69.87%   +0.26%     
===========================================
  Files           85       86       +1     
  Lines        11921    12141     +220     
  Branches      1670     1711      +41     
===========================================
+ Hits          8298     8483     +185     
- Misses        3252     3281      +29     
- Partials       371      377       +6     
```


| [Impacted Files](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [azurelinuxagent/ga/env.py](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918/diff?src=pr&el=tree#diff-YXp1cmVsaW51eGFnZW50L2dhL2Vudi5weQ==) | `51.66% <60.00%> (+0.80%)` | :arrow_up: |
| [azurelinuxagent/ga/update.py](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918/diff?src=pr&el=tree#diff-YXp1cmVsaW51eGFnZW50L2dhL3VwZGF0ZS5weQ==) | `87.48% <81.81%> (-0.31%)` | :arrow_down: |
| [azurelinuxagent/ga/extension\_telemetry.py](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918/diff?src=pr&el=tree#diff-YXp1cmVsaW51eGFnZW50L2dhL2V4dGVuc2lvbl90ZWxlbWV0cnkucHk=) | `82.82% <82.82%> (ø)` | |
| [azurelinuxagent/common/event.py](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918/diff?src=pr&el=tree#diff-YXp1cmVsaW51eGFnZW50L2NvbW1vbi9ldmVudC5weQ==) | `86.11% <100.00%> (+0.15%)` | :arrow_up: |
| [azurelinuxagent/common/exception.py](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918/diff?src=pr&el=tree#diff-YXp1cmVsaW51eGFnZW50L2NvbW1vbi9leGNlcHRpb24ucHk=) | `98.94% <100.00%> (+0.07%)` | :arrow_up: |
| [azurelinuxagent/ga/exthandlers.py](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918/diff?src=pr&el=tree#diff-YXp1cmVsaW51eGFnZW50L2dhL2V4dGhhbmRsZXJzLnB5) | `86.31% <100.00%> (+0.04%)` | :arrow_up: |
| [azurelinuxagent/ga/monitor.py](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918/diff?src=pr&el=tree#diff-YXp1cmVsaW51eGFnZW50L2dhL21vbml0b3IucHk=) | `77.84% <100.00%> (+0.51%)` | :arrow_up: |
| [azurelinuxagent/pa/deprovision/default.py](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918/diff?src=pr&el=tree#diff-YXp1cmVsaW51eGFnZW50L3BhL2RlcHJvdmlzaW9uL2RlZmF1bHQucHk=) | `67.85% <100.00%> (ø)` | |
| [azurelinuxagent/common/logger.py](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918/diff?src=pr&el=tree#diff-YXp1cmVsaW51eGFnZW50L2NvbW1vbi9sb2dnZXIucHk=) | `92.16% <0.00%> (+1.20%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918?src=pr&el=footer). Last update [71654c4...85f54e3](https://codecov.io/gh/Azure/WALinuxAgent/pull/1918?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/azurelinuxagent/common/event.py b/azurelinuxagent/common/event.py
index 07a69c29..122364cf 100644
--- a/azurelinuxagent/common/event.py
+++ b/azurelinuxagent/common/event.py
@@ -86,6 +86,7 @@ class WALAEventOperation:
     Download = "Download"
     Enable = "Enable"
     ExtensionProcessing = "ExtensionProcessing"
+    ExtensionTelemetryEventProcessing = "ExtensionTelemetryEventProcessing"
     FetchGoalState = "FetchGoalState"
     Firewall = "Firewall"
     HealthCheck = "HealthCheck"
@@ -437,7 +438,7 @@ class EventLogger(object):
         event.parameters.append(TelemetryEventParam(GuestAgentExtensionEventsSchema.OperationSuccess, bool(is_success)))
         event.parameters.append(TelemetryEventParam(GuestAgentExtensionEventsSchema.Message, str(message)))
         event.parameters.append(TelemetryEventParam(GuestAgentExtensionEventsSchema.Duration, int(duration)))
-        self._add_common_event_parameters(event, datetime.utcnow())
+        self.add_common_event_parameters(event, datetime.utcnow())
 
         data = get_properties(event)
         try:
@@ -452,7 +453,7 @@ class EventLogger(object):
         event.parameters.append(TelemetryEventParam(GuestAgentGenericLogsSchema.Context1, self._clean_up_message(message)))
         event.parameters.append(TelemetryEventParam(GuestAgentGenericLogsSchema.Context2, datetime.utcnow().strftime(logger.Logger.LogTimeFormatInUTC)))
         event.parameters.append(TelemetryEventParam(GuestAgentGenericLogsSchema.Context3, ''))
-        self._add_common_event_parameters(event, datetime.utcnow())
+        self.add_common_event_parameters(event, datetime.utcnow())
 
         data = get_properties(event)
         try:
@@ -480,7 +481,7 @@ class EventLogger(object):
         event.parameters.append(TelemetryEventParam(GuestAgentPerfCounterEventsSchema.Counter, str(counter)))
         event.parameters.append(TelemetryEventParam(GuestAgentPerfCounterEventsSchema.Instance, str(instance)))
         event.parameters.append(TelemetryEventParam(GuestAgentPerfCounterEventsSchema.Value, float(value)))
-        self._add_common_event_parameters(event, datetime.utcnow())
+        self.add_common_event_parameters(event, datetime.utcnow())
 
         data = get_properties(event)
         try:
@@ -529,7 +530,7 @@ class EventLogger(object):
             else:
                 return message
 
-    def _add_common_event_parameters(self, event, event_timestamp):
+    def add_common_event_parameters(self, event, event_timestamp):
         """
         This method is called for all events and ensures all telemetry fields are added before the event is sent out.
         Note that the event timestamp is saved in the OpcodeName field.
@@ -625,7 +626,7 @@ class EventLogger(object):
 
                         if event.is_extension_event():
                             EventLogger._trim_extension_event_parameters(event)
-                            self._add_common_event_parameters(event, event_file_creation_time)
+                            self.add_common_event_parameters(event, event_file_creation_time)
                         else:
                             self._update_legacy_agent_event(event, event_file_creation_time)
 
@@ -654,7 +655,7 @@ class EventLogger(object):
         # will be appended, ensuring the event schema is complete before the event is reported.
         new_event = TelemetryEvent()
         new_event.parameters = []
-        self._add_common_event_parameters(new_event, event_creation_time)
+        self.add_common_event_parameters(new_event, event_creation_time)
 
         event_params = dict([(param.name, param.value) for param in event.parameters])
         new_event_params = dict([(param.name, param.value) for param in new_event.parameters])
@@ -669,6 +670,9 @@ class EventLogger(object):
 
 __event_logger__ = EventLogger()
 
+def get_event_logger():
+    return __event_logger__
+
 
 def elapsed_milliseconds(utc_start):
     now = datetime.utcnow()
diff --git a/azurelinuxagent/common/exception.py b/azurelinuxagent/common/exception.py
index 3e868c05..f4e1f502 100644
--- a/azurelinuxagent/common/exception.py
+++ b/azurelinuxagent/common/exception.py
@@ -210,6 +210,19 @@ class ResourceGoneError(HttpError):
         super(ResourceGoneError, self).__init__(msg, inner)
 
 
+class InvalidExtensionEventError(AgentError):
+    """
+    Error thrown when the extension telemetry event is invalid as defined per the contract with extensions.
+    """
+    # Types of InvalidExtensionEventError
+    MissingKeyError = "MissingKeyError"
+    EmptyMessageError = "EmptyMessageError"
+    OversizeEventError = "OversizeEventError"
+
+    def __init__(self, msg=None, inner=None):
+        super(InvalidExtensionEventError, self).__init__(msg, inner)
+
+
 class ExtensionErrorCodes(object):
     """
     Common Error codes used across by Compute RP for better understanding
diff --git a/azurelinuxagent/ga/env.py b/azurelinuxagent/ga/env.py
index 8c899552..63586163 100644
--- a/azurelinuxagent/ga/env.py
+++ b/azurelinuxagent/ga/env.py
@@ -54,6 +54,13 @@ class EnvHandler(object):
     Monitor scsi disk.
     If new scsi disk found, set timeout
     """
+
+    _THREAD_NAME = "EnvHandler"
+
+    @staticmethod
+    def get_thread_name():
+        return EnvHandler._THREAD_NAME
+
     def __init__(self):
         self.osutil = get_osutil()
         self.dhcp_handler = get_dhcp_handler()
@@ -97,7 +104,7 @@ class EnvHandler(object):
     def start(self):
         self.server_thread = threading.Thread(target=self.monitor)
         self.server_thread.setDaemon(True)
-        self.server_thread.setName("EnvHandler")
+        self.server_thread.setName(self.get_thread_name())
         self.server_thread.start()
 
     def monitor(self):
diff --git a/azurelinuxagent/ga/extension_telemetry.py b/azurelinuxagent/ga/extension_telemetry.py
new file mode 100644
index 00000000..120b055a
--- /dev/null
+++ b/azurelinuxagent/ga/extension_telemetry.py
@@ -0,0 +1,402 @@
+# Microsoft Azure Linux Agent
+#
+# Copyright 2020 Microsoft Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Requires Python 2.6+ and Openssl 1.0+
+#
+import datetime
+import json
+import os
+import re
+import threading
+from collections import defaultdict
+
+import azurelinuxagent.common.logger as logger
+from azurelinuxagent.common import conf
+from azurelinuxagent.common.event import EVENTS_DIRECTORY, TELEMETRY_LOG_EVENT_ID, \
+    TELEMETRY_LOG_PROVIDER_ID, add_event, WALAEventOperation, add_log_event, get_event_logger
+from azurelinuxagent.common.exception import InvalidExtensionEventError
+from azurelinuxagent.common.future import ustr
+from azurelinuxagent.common.telemetryevent import TelemetryEventList, TelemetryEvent, TelemetryEventParam, \
+    GuestAgentGenericLogsSchema
+from azurelinuxagent.ga.exthandlers import HANDLER_NAME_PATTERN
+from azurelinuxagent.ga.periodic_operation import PeriodicOperation
+
+
+def get_extension_telemetry_handler(protocol_util):
+    return ExtensionTelemetryHandler(protocol_util)
+
+class ExtensionEventSchema(object):
+    """
+    Class for defining the schema for Extension Events.
+    """
+    Version = "Version"
+    Timestamp = "Timestamp"
+    TaskName = "TaskName"
+    EventLevel = "EventLevel"
+    Message = "Message"
+    EventPid = "EventPid"
+    EventTid = "EventTid"
+    OperationId = "OperationId"
+
+class ProcessExtensionTelemetry(PeriodicOperation):
+    """
+    Periodic operation for collecting and sending extension telemetry events to Wireserver.
+    """
+
+    _EXTENSION_EVENT_COLLECTION_PERIOD = datetime.timedelta(minutes=5)
+    _EXTENSION_EVENT_FILE_NAME_REGEX = re.compile(r"^(\d+)\.json$", re.IGNORECASE)
+
+    # Limits
+    _MAX_NUMBER_OF_EVENTS_PER_EXTENSION_PER_PERIOD = 300
+    _EXTENSION_EVENT_FILE_MAX_SIZE = 4 * 1024 * 1024  # 4 MB = 4 * 1,048,576 Bytes
+    _EXTENSION_EVENT_MAX_SIZE = 1024 * 6  # 6Kb or 6144 characters. Limit for the whole event. Prevent oversized events.
+    _EXTENSION_EVENT_MAX_MSG_LEN = 1024 * 3  # 3Kb or 3072 chars.
+
+    _EXTENSION_EVENT_REQUIRED_FIELDS = [attr.lower() for attr in dir(ExtensionEventSchema) if
+                                        not callable(getattr(ExtensionEventSchema, attr)) and not attr.startswith("__")]
+
+    def __init__(self, protocol_util):
+        super(ProcessExtensionTelemetry, self).__init__(
+            name="collect and send extension events",
+            operation=self._collect_and_send_events,
+            period=ProcessExtensionTelemetry._EXTENSION_EVENT_COLLECTION_PERIOD)
+
+        self._protocol = protocol_util.get_protocol()
+
+    def _collect_and_send_events(self):
+        event_list = self._collect_extension_events()
+
+        if len(event_list.events) > 0:
+            self._protocol.report_event(event_list)
+
+    def _collect_extension_events(self):
+        events_list = TelemetryEventList()
+        extension_handler_with_event_dirs = []
+
+        try:
+            extension_handler_with_event_dirs = self._get_extension_events_dir_with_handler_name(conf.get_ext_log_dir())
+
+            if len(extension_handler_with_event_dirs) == 0:
+                logger.verbose("No Extension events directory exist")
+                return events_list
+
+            for extension_handler_with_event_dir in extension_handler_with_event_dirs:
+                handler_name = extension_handler_with_event_dir[0]
+                handler_event_dir_path = extension_handler_with_event_dir[1]
+                self._capture_extension_events(handler_name, handler_event_dir_path, events_list)
+        except Exception as e:
+            msg = "Unknown error occurred when trying to collect extension events. Error: {0}".format(ustr(e))
+            add_event(op=WALAEventOperation.ExtensionTelemetryEventProcessing, message=msg, is_success=False)
+        finally:
+            # Always ensure that the events directory are being deleted each run,
+            # even if we run into an error and dont process them this run.
+            self._ensure_all_events_directories_empty(extension_handler_with_event_dirs)
+            return events_list
+
+    @staticmethod
+    def _get_extension_events_dir_with_handler_name(extension_log_dir):
+        """
+        Get the full path to events directory for all extension handlers that have one
+        :param extension_log_dir: Base log directory for all extensions
+        :return: A list of full paths of existing events directory for all handlers
+        """
+        extension_handler_with_event_dirs = []
+
+        for ext_handler_name in os.listdir(extension_log_dir):
+            # Check if its an Extension directory
+            if not os.path.isdir(os.path.join(extension_log_dir, ext_handler_name)) \
+                    or re.match(HANDLER_NAME_PATTERN, ext_handler_name) is None:
+                continue
+
+            # Check if EVENTS_DIRECTORY directory exists
+            extension_event_dir = os.path.join(extension_log_dir, ext_handler_name, EVENTS_DIRECTORY)
+            if os.path.exists(extension_event_dir):
+                extension_handler_with_event_dirs.append((ext_handler_name, extension_event_dir))
+
+        return extension_handler_with_event_dirs
+
+    def _capture_extension_events(self, handler_name, handler_event_dir_path, events_list):
+        """
+        Capture Extension events and add them to the events_list
+        :param handler_name: Complete Handler Name. Eg: Microsoft.CPlat.Core.RunCommandLinux
+        :param handler_event_dir_path: Full path. Eg: '/var/log/azure/Microsoft.CPlat.Core.RunCommandLinux/events'
+        :param events_list: List of captured extension events
+        """
+
+        convert_to_mb = lambda x: (1.0 * x)/(1000 * 1000)
+
+        # Filter out the files that do not follow the pre-defined EXTENSION_EVENT_FILE_NAME_REGEX
+        event_files = [event_file for event_file in os.listdir(handler_event_dir_path) if
+                       re.match(self._EXTENSION_EVENT_FILE_NAME_REGEX, event_file) is not None]
+        # Pick the latest files first, we'll discard older events if len(events) > MAX_EVENT_COUNT
+        event_files.sort(reverse=True)
+
+        captured_extension_events_count = 0
+        dropped_events_with_error_count = defaultdict(int)
+
+        for event_file in event_files:
+
+            event_file_path = os.path.join(handler_event_dir_path, event_file)
+            try:
+                logger.verbose("Processing event file: {0}", event_file_path)
+
+                # We only support _EXTENSION_EVENT_FILE_MAX_SIZE=4Mb max file size
+                event_file_size = os.stat(event_file_path).st_size
+                if event_file_size > self._EXTENSION_EVENT_FILE_MAX_SIZE:
+                    msg = "Skipping file: {0} as its size is {1:.2f} Mb > Max size allowed {2:.1f} Mb".format(
+                            event_file_path, convert_to_mb(event_file_size),
+                            convert_to_mb(self._EXTENSION_EVENT_FILE_MAX_SIZE))
+                    logger.warn(msg)
+                    add_log_event(level=logger.LogLevel.WARNING, message=msg, forced=True)
+                    continue
+
+                # We support multiple events in a file, read the file and parse events.
+                parsed_events = self._parse_event_file_and_capture_events(handler_name, event_file_path,
+                                                                          captured_extension_events_count,
+                                                                          dropped_events_with_error_count)
+                events_list.events.extend(parsed_events)
+                captured_extension_events_count += len(parsed_events)
+
+                # We only allow MAX_NUMBER_OF_EVENTS_PER_EXTENSION_PER_PERIOD=300 maximum events per period per handler
+                if captured_extension_events_count >= self._MAX_NUMBER_OF_EVENTS_PER_EXTENSION_PER_PERIOD:
+                    msg = "Reached max count for the extension: {0}; Max Limit: {1}. Skipping the rest.".format(
+                        handler_name, self._MAX_NUMBER_OF_EVENTS_PER_EXTENSION_PER_PERIOD)
+                    logger.warn(msg)
+                    add_log_event(level=logger.LogLevel.WARNING, message=msg, forced=True)
+                    break
+
+            except Exception as e:
+                msg = "Failed to process event file {0}: {1}", event_file, ustr(e)
+                logger.warn(msg)
+                add_log_event(level=logger.LogLevel.WARNING, message=msg, forced=True)
+            finally:
+                os.remove(event_file_path)
+
+        if dropped_events_with_error_count is not None and len(dropped_events_with_error_count) > 0:
+            msg = "Dropped events for Extension: {0}; Details:\n\t{1}".format(handler_name, '\n\t'.join(
+                ["Reason: {0}; Dropped Count: {1}".format(k, v) for k, v in dropped_events_with_error_count.items()]))
+            logger.warn(msg)
+            add_log_event(level=logger.LogLevel.WARNING, message=msg, forced=True)
+
+        if captured_extension_events_count > 0:
+            logger.info("Collected {0} events for extension: {1}".format(captured_extension_events_count, handler_name))
+
+    @staticmethod
+    def _ensure_all_events_directories_empty(extension_events_directories):
+        if len(extension_events_directories) == 0:
+            return
+
+        for extension_handler_with_event_dir in extension_events_directories:
+            event_dir_path = extension_handler_with_event_dir[1]
+            if not os.path.exists(event_dir_path):
+                return
+
+            err = None
+            # Delete any residue files in the events directory
+            for residue_file in os.listdir(event_dir_path):
+                try:
+                    os.remove(os.path.join(event_dir_path, residue_file))
+                except Exception as e:
+                    # Only log the first error once per handler per run if unable to clean off residue files
+                    err = ustr(e) if err is None else err
+
+                if err is not None:
+                    logger.error("Failed to completely clear the {0} directory. Exception: {1}", event_dir_path, err)
+
+    def _parse_event_file_and_capture_events(self, handler_name, event_file_path, captured_events_count,
+                                             dropped_events_with_error_count):
+        events_list = []
+        event_file_time = datetime.datetime.fromtimestamp(os.path.getmtime(event_file_path))
+
+        # Read event file and decode it properly
+        with open(event_file_path, "rb") as fd:
+            event_data = fd.read().decode("utf-8")
+
+        # Parse the string and get the list of events
+        events = json.loads(event_data)
+
+        # We allow multiple events in a file but there can be an instance where the file only has a single
+        # JSON event and not a list. Handling that condition too
+        if not isinstance(events, list):
+            events = [events]
+
+        for event in events:
+            try:
+                events_list.append(self._parse_telemetry_event(handler_name, event, event_file_time))
+                captured_events_count += 1
+            except InvalidExtensionEventError as e:
+                # These are the errors thrown if there's an error parsing the event. We want to report these back to the
+                # extension publishers so that they are aware of the issues.
+                # The error messages are all static messages, we will use this to create a dict and emit an event at the
+                # end of each run to notify if there were any errors parsing events for the extension
+                dropped_events_with_error_count[ustr(e)] += 1
+            except Exception as e:
+                logger.warn("Unable to parse and transmit event, error: {0}".format(e))
+
+            if captured_events_count >= self._MAX_NUMBER_OF_EVENTS_PER_EXTENSION_PER_PERIOD:
+                break
+
+        return events_list
+
+    def _parse_telemetry_event(self, handler_name, extension_unparsed_event, event_file_time):
+        """
+        Parse the Json event file and convert it to TelemetryEvent object with the required data.
+        :return: Complete TelemetryEvent with all required fields filled up properly. Raises if event breaches contract.
+        """
+
+        extension_event = self._parse_event_and_ensure_it_is_valid(extension_unparsed_event)
+
+        # Create a telemetry event, add all common parameters to the event
+        # and then overwrite all the common params with extension events params if same
+
+        event = TelemetryEvent(TELEMETRY_LOG_EVENT_ID, TELEMETRY_LOG_PROVIDER_ID)
+        event.file_type = "json"
+        self.add_common_params_to_extension_event(event, event_file_time)
+
+        replace_or_add_params = {
+            GuestAgentGenericLogsSchema.EventName: "{0}-{1}".format(handler_name, extension_event[
+                ExtensionEventSchema.Version.lower()]),
+            GuestAgentGenericLogsSchema.CapabilityUsed: extension_event[ExtensionEventSchema.EventLevel.lower()],
+            GuestAgentGenericLogsSchema.TaskName: extension_event[ExtensionEventSchema.TaskName.lower()],
+            GuestAgentGenericLogsSchema.Context1: extension_event[ExtensionEventSchema.Message.lower()],
+            GuestAgentGenericLogsSchema.Context2: extension_event[ExtensionEventSchema.Timestamp.lower()],
+            GuestAgentGenericLogsSchema.Context3: extension_event[ExtensionEventSchema.OperationId.lower()],
+            GuestAgentGenericLogsSchema.EventPid: extension_event[ExtensionEventSchema.EventPid.lower()],
+            GuestAgentGenericLogsSchema.EventTid: extension_event[ExtensionEventSchema.EventTid.lower()]
+        }
+        self._replace_or_add_param_in_event(event, replace_or_add_params)
+        return event
+
+    def _parse_event_and_ensure_it_is_valid(self, extension_event):
+        """
+        Parse the Json event from file. Raise InvalidExtensionEventError if the event breaches pre-set contract.
+        :param extension_event: The json event from file
+        :return: Verified Json event that qualifies the contract.
+        """
+
+        clean_string = lambda x: x.strip() if x is not None else x
+
+        event_size = 0
+        key_err_msg = "{0}: {1} not found"
+
+        # Convert the dict to all lower keys to avoid schema confusion.
+        # Only pick the params that we care about and skip the rest.
+        event = dict((k.lower(), clean_string(v)) for k, v in extension_event.items() if
+                     k.lower() in self._EXTENSION_EVENT_REQUIRED_FIELDS)
+
+        # Trim message and only pick the first 3k chars
+        message_key = ExtensionEventSchema.Message.lower()
+        if message_key in event:
+            event[message_key] = event[message_key][:self._EXTENSION_EVENT_MAX_MSG_LEN]
+        else:
+            raise InvalidExtensionEventError(
+                key_err_msg.format(InvalidExtensionEventError.MissingKeyError, ExtensionEventSchema.Message))
+
+        if event[message_key] is None or len(event[message_key]) == 0:
+            raise InvalidExtensionEventError(
+                "{0}: {1} should not be empty".format(InvalidExtensionEventError.EmptyMessageError,
+                                                     ExtensionEventSchema.Message))
+
+        for required_key in self._EXTENSION_EVENT_REQUIRED_FIELDS:
+            # If all required keys not in event then raise
+            if not required_key in event:
+                raise InvalidExtensionEventError(
+                    key_err_msg.format(InvalidExtensionEventError.MissingKeyError, required_key))
+
+            # If the event_size > _EXTENSION_EVENT_MAX_SIZE=6k, then raise
+            if event_size > self._EXTENSION_EVENT_MAX_SIZE:
+                raise InvalidExtensionEventError(
+                    "{0}: max event size allowed: {1}".format(InvalidExtensionEventError.OversizeEventError,
+                                                              self._EXTENSION_EVENT_MAX_SIZE))
+
+            event_size += len(event[required_key])
+
+        return event
+
+    @staticmethod
+    def _replace_or_add_param_in_event(event, replace_or_add_params):
+        for param in event.parameters:
+            if param.name in replace_or_add_params:
+                param.value = replace_or_add_params.pop(param.name)
+
+        if not replace_or_add_params:
+            # All values replaced, return
+            return
+
+        # Add the remaining params to the event
+        for param_name in replace_or_add_params:
+            event.parameters.append(TelemetryEventParam(param_name, replace_or_add_params[param_name]))
+
+    @staticmethod
+    def add_common_params_to_extension_event(event, event_time):
+        reporter = get_event_logger()
+        reporter.add_common_event_parameters(event, event_time)
+
+
+class ExtensionTelemetryHandler(object):
+    """
+    This Handler takes care of fetching the Extension Telemetry events from the {extension_events_dir} and sends it to
+    Kusto for advanced debuggability.
+    """
+
+    _THREAD_NAME = "ExtensionTelemetryHandler"
+
+    def __init__(self, protocol_util):
+        self.protocol_util = protocol_util
+        self.should_run = True
+        self.thread = None
+
+    @staticmethod
+    def get_thread_name():
+        return ExtensionTelemetryHandler._THREAD_NAME
+
+    def run(self):
+        logger.info("Start Extension Telemetry service.")
+        self.start()
+
+    def is_alive(self):
+        return self.thread is not None and self.thread.is_alive()
+
+    def start(self):
+        self.thread = threading.Thread(target=self.daemon)
+        self.thread.setDaemon(True)
+        self.thread.setName(ExtensionTelemetryHandler.get_thread_name())
+        self.thread.start()
+
+    def stop(self):
+        """
+        Stop server communication and join the thread to main thread.
+        """
+        self.should_run = False
+        if self.is_alive():
+            self.thread.join()
+
+    def stopped(self):
+        return not self.should_run
+
+    def daemon(self):
+        op = ProcessExtensionTelemetry(self.protocol_util)
+        logger.info("Successfully started the {0} thread".format(self.get_thread_name()))
+        while not self.stopped():
+            try:
+                op.run()
+
+            except Exception as e:
+                logger.warn(
+                    "An error occurred in the Telemetry Extension thread main loop; will skip the current iteration.\n{0}",
+                    ustr(e))
+            finally:
+                PeriodicOperation.sleep_until_next_operation([op])
\ No newline at end of file
diff --git a/azurelinuxagent/ga/exthandlers.py b/azurelinuxagent/ga/exthandlers.py
index 0c113815..25c3220a 100644
--- a/azurelinuxagent/ga/exthandlers.py
+++ b/azurelinuxagent/ga/exthandlers.py
@@ -50,14 +50,16 @@ from azurelinuxagent.common.utils.flexible_version import FlexibleVersion
 from azurelinuxagent.common.version import AGENT_NAME, CURRENT_VERSION, DISTRO_NAME, DISTRO_VERSION, \
     GOAL_STATE_AGENT_VERSION, PY_VERSION_MAJOR, PY_VERSION_MICRO, PY_VERSION_MINOR
 
-
-_HANDLER_PATTERN = r'^([^-]+)-(\d+(?:\.\d+)*)'
+_HANDLER_NAME_PATTERN = r'^([^-]+)'
+_HANDLER_VERSION_PATTERN = r'(\d+(?:\.\d+)*)'
+_HANDLER_PATTERN = _HANDLER_NAME_PATTERN + r"-" + _HANDLER_VERSION_PATTERN #r'^([^-]+)-(\d+(?:\.\d+)*)'
 _HANDLER_PKG_PATTERN = re.compile(_HANDLER_PATTERN + r'\.zip$', re.IGNORECASE)
 _DEFAULT_EXT_TIMEOUT_MINUTES = 90
 
 _VALID_HANDLER_STATUS = ['Ready', 'NotReady', "Installing", "Unresponsive"]
 
-HANDLER_NAME_PATTERN = re.compile(_HANDLER_PATTERN + r'$', re.IGNORECASE)
+HANDLER_NAME_PATTERN = re.compile(_HANDLER_NAME_PATTERN, re.IGNORECASE)
+HANDLER_COMPLETE_NAME_PATTERN = re.compile(_HANDLER_PATTERN + r'$', re.IGNORECASE)
 HANDLER_PKG_EXT = ".zip"
 
 AGENT_STATUS_FILE = "waagent_status.json"
diff --git a/azurelinuxagent/ga/monitor.py b/azurelinuxagent/ga/monitor.py
index 349b1788..7470da88 100644
--- a/azurelinuxagent/ga/monitor.py
+++ b/azurelinuxagent/ga/monitor.py
@@ -167,6 +167,12 @@ class MonitorHandler(object):
     IMDS_HEARTBEAT_PERIOD = datetime.timedelta(minutes=1)
     IMDS_HEALTH_PERIOD = datetime.timedelta(minutes=3)
 
+    _THREAD_NAME = "MonitorHandler"
+
+    @staticmethod
+    def get_thread_name():
+        return MonitorHandler._THREAD_NAME
+
     def __init__(self):
         self.osutil = get_osutil()
         self.imds_client = None
@@ -222,7 +228,7 @@ class MonitorHandler(object):
     def start(self, init_data=False):
         self.event_thread = threading.Thread(target=self.daemon, args=(init_data,))
         self.event_thread.setDaemon(True)
-        self.event_thread.setName("MonitorHandler")
+        self.event_thread.setName(self.get_thread_name())
         self.event_thread.start()
 
     def daemon(self, init_data=False):
diff --git a/azurelinuxagent/ga/update.py b/azurelinuxagent/ga/update.py
index 969b72d7..b1b7ad7e 100644
--- a/azurelinuxagent/ga/update.py
+++ b/azurelinuxagent/ga/update.py
@@ -53,9 +53,12 @@ from azurelinuxagent.common.utils.flexible_version import FlexibleVersion
 from azurelinuxagent.common.version import AGENT_NAME, AGENT_VERSION, AGENT_DIR_PATTERN, CURRENT_AGENT,\
     CURRENT_VERSION, DISTRO_NAME, DISTRO_VERSION, is_current_agent_installed, PY_VERSION_MAJOR, PY_VERSION_MINOR, \
     PY_VERSION_MICRO
+from azurelinuxagent.ga.env import get_env_handler
+from azurelinuxagent.ga.extension_telemetry import get_extension_telemetry_handler
 
 from azurelinuxagent.ga.exthandlers import HandlerManifest, get_traceback, ExtHandlersHandler, \
     is_extension_telemetry_pipeline_enabled, list_agent_lib_directory
+from azurelinuxagent.ga.monitor import get_monitor_handler
 
 AGENT_ERROR_FILE = "error.json" # File name for agent error record
 AGENT_MANIFEST_FILE = "HandlerManifest.json"
@@ -268,15 +271,20 @@ class UpdateHandler(object):
                 PY_VERSION_MINOR, PY_VERSION_MICRO)
             logger.info(os_info_msg)
             add_event(AGENT_NAME, op=WALAEventOperation.OSInfo, message=os_info_msg)
-            
-            # Launch monitoring threads
-            from azurelinuxagent.ga.monitor import get_monitor_handler
-            monitor_thread = get_monitor_handler()
-            monitor_thread.run()
 
-            from azurelinuxagent.ga.env import get_env_handler
-            env_thread = get_env_handler()
-            env_thread.run()
+            # Get all thread handlers
+            all_thread_handlers = [
+                get_monitor_handler(),
+                get_env_handler()
+            ]
+
+            if is_extension_telemetry_pipeline_enabled():
+                # Reuse the same protocol_util as the UpdateHandler class to avoid new initializations
+                all_thread_handlers.append(get_extension_telemetry_handler(self.protocol_util))
+
+            # Launch all monitoring threads
+            for thread_handler in all_thread_handlers:
+                thread_handler.run()
 
             from azurelinuxagent.ga.exthandlers import get_exthandlers_handler, migrate_handler_state
             exthandlers_handler = get_exthandlers_handler(protocol)
@@ -306,13 +314,10 @@ class UpdateHandler(object):
                 #
                 # Check that all the threads are still running
                 #
-                if not monitor_thread.is_alive():
-                    logger.warn(u"Monitor thread died, restarting")
-                    monitor_thread.start()
-
-                if not env_thread.is_alive():
-                    logger.warn(u"Environment thread died, restarting")
-                    env_thread.start()
+                for thread_handler in all_thread_handlers:
+                    if not thread_handler.is_alive():
+                        logger.warn("{0} thread died, restarting".format(thread_handler.get_thread_name()))
+                        thread_handler.start()
 
                 #
                 # Process the goal state
diff --git a/azurelinuxagent/pa/deprovision/default.py b/azurelinuxagent/pa/deprovision/default.py
index dac3b89c..b54d407c 100644
--- a/azurelinuxagent/pa/deprovision/default.py
+++ b/azurelinuxagent/pa/deprovision/default.py
@@ -31,7 +31,7 @@ from azurelinuxagent.common import version
 from azurelinuxagent.common.exception import ProtocolError
 from azurelinuxagent.common.osutil import get_osutil
 from azurelinuxagent.common.protocol.util import get_protocol_util
-from azurelinuxagent.ga.exthandlers import HANDLER_NAME_PATTERN
+from azurelinuxagent.ga.exthandlers import HANDLER_COMPLETE_NAME_PATTERN
 
 
 def read_input(message):
@@ -125,7 +125,7 @@ class DeprovisionHandler(object):
     def del_ext_handler_files(self, warnings, actions):
         ext_dirs = [d for d in os.listdir(conf.get_lib_dir())
                     if os.path.isdir(os.path.join(conf.get_lib_dir(), d))
-                    and re.match(HANDLER_NAME_PATTERN, d) is not None
+                    and re.match(HANDLER_COMPLETE_NAME_PATTERN, d) is not None
                     and not version.is_agent_path(d)]
 
         for ext_dir in ext_dirs:


Test patch:
diff --git a/tests/data/events/extension_events/different_cases/1591918616.json b/tests/data/events/extension_events/different_cases/1591918616.json
new file mode 100644
index 00000000..2ea56399
--- /dev/null
+++ b/tests/data/events/extension_events/different_cases/1591918616.json
@@ -0,0 +1,22 @@
+[
+    {
+        "eventlevel": "INFO",
+        "Message": "Files downloaded. Asynchronously executing command: 'SecureCommand_11'",
+        "Version": "1",
+        "TASKNAME": "Downloading files",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "tIMEsTAMP": "2019-12-12T01:21:05.1960563Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "MESSAGE": "HandlerEnvironment = Version: 1, HandlerEnvironment: [LogFolder: \"C:\\WindowsAzure\\Logs\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\", ConfigFolder: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\RuntimeSettings\", StatusFolder: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\Status\", HeartbeatFile: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\Status\\HeartBeat.Json\"]",
+        "version": "1",
+        "TaskName": "Downloading files",
+        "EventPID": "3228",
+        "EVENTTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:21:05.1960563Z"
+    }
+]
\ No newline at end of file
diff --git a/tests/data/events/extension_events/empty_message/1592350454.json b/tests/data/events/extension_events/empty_message/1592350454.json
new file mode 100644
index 00000000..2cb59999
--- /dev/null
+++ b/tests/data/events/extension_events/empty_message/1592350454.json
@@ -0,0 +1,24 @@
+[
+  {
+      "EventLevel": "INFO",
+      "Message": null,
+      "Version": "1",
+      "TaskName": "Downloading files",
+      "EventPid": "3228",
+      "EventTid": "1",
+      "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+      "TimeStamp": "2019-12-12T01:21:05.1960563Z",
+      "BadEvent": true
+    },
+    {
+      "EventLevel": "INFO",
+      "Message": "",
+      "Version": "1",
+      "TaskName": "Downloading files",
+      "EventPid": "3228",
+      "EventTid": "1",
+      "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+      "TimeStamp": "2019-12-12T01:21:05.1960563Z",
+      "BadEvent": true
+    }
+]
\ No newline at end of file
diff --git a/tests/data/events/extension_events/extra_parameters/1592273009.json b/tests/data/events/extension_events/extra_parameters/1592273009.json
new file mode 100644
index 00000000..934c96c7
--- /dev/null
+++ b/tests/data/events/extension_events/extra_parameters/1592273009.json
@@ -0,0 +1,35 @@
+[
+    {
+        "EventLevel": "INFO",
+        "Message": "Files downloaded. Asynchronously executing command: 'SecureCommand_11'",
+        "Version": "1",
+        "TaskName": "Downloading files",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:21:05.1960563Z",
+        "SomethingNewButNotCool": "This is a random new param"
+    },
+    {
+        "EL": "INFO",
+        "msg": "HandlerEnvironment = Version: 1, HandlerEnvironment: [LogFolder: \"C:\\WindowsAzure\\Logs\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\", ConfigFolder: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\RuntimeSettings\", StatusFolder: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\Status\", HeartbeatFile: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\Status\\HeartBeat.Json\"]",
+        "ver": "1",
+        "TaskName": "Downloading files",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "Time": "2019-12-12T01:21:05.1960563Z",
+        "BadEvent": true
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Hello World",
+        "Version": "1",
+        "TaskName": "Downloading files",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:21:05.1960563Z",
+        "SomethingVeryWeird": "Weirdly weird but satisfying"
+    }
+]
\ No newline at end of file
diff --git a/tests/data/events/extension_events/large_messages/1591921510.json b/tests/data/events/extension_events/large_messages/1591921510.json
new file mode 100644
index 00000000..e85d28c1
--- /dev/null
+++ b/tests/data/events/extension_events/large_messages/1591921510.json
@@ -0,0 +1,12 @@
+[
+    {
+        "EventLevel": "INFO",
+        "Message": "[MESSAGE_START] Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 Files downloaded. Asynchronously executing command: 'SecureCommand_11 [MESSAGE_END]",
+        "Version": "1",
+        "TaskName": "Downloading files",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:21:05.1960563Z"
+    }
+]
\ No newline at end of file
diff --git a/tests/data/events/extension_events/malformed_files/1592008079.json b/tests/data/events/extension_events/malformed_files/1592008079.json
new file mode 100644
index 00000000..7f2b5c33
--- /dev/null
+++ b/tests/data/events/extension_events/malformed_files/1592008079.json
@@ -0,0 +1,13 @@
+[
+    {
+        "EventLevel": "" ,
+        "Message": null,
+        "Version":  "",
+        "TaskName": null,
+        "EventPid": null,
+        "EventTid": null,
+        "OperationId": null,
+        "TimeStamp": null,
+        "BadEvent": true
+    }
+]
\ No newline at end of file
diff --git a/tests/data/events/extension_events/malformed_files/1594857360.tld b/tests/data/events/extension_events/malformed_files/1594857360.tld
new file mode 100644
index 00000000..9a5e5e42
--- /dev/null
+++ b/tests/data/events/extension_events/malformed_files/1594857360.tld
@@ -0,0 +1,11 @@
+{
+        "EventLevel": "INFO",
+        "Message": "Enabling Handler",
+        "Version": "1",
+        "TaskName": "Handler Operation",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z",
+        "BadEvent": true
+}
\ No newline at end of file
diff --git a/tests/data/events/extension_events/malformed_files/bad_json_files/1591816395.json b/tests/data/events/extension_events/malformed_files/bad_json_files/1591816395.json
new file mode 100644
index 00000000..d18a00ae
--- /dev/null
+++ b/tests/data/events/extension_events/malformed_files/bad_json_files/1591816395.json
@@ -0,0 +1,3 @@
+{
+  "BadEvent": true
+  ]
\ No newline at end of file
diff --git a/tests/data/events/extension_events/malformed_files/bad_name_file.json b/tests/data/events/extension_events/malformed_files/bad_name_file.json
new file mode 100644
index 00000000..b72a8e19
--- /dev/null
+++ b/tests/data/events/extension_events/malformed_files/bad_name_file.json
@@ -0,0 +1,24 @@
+[
+    {
+        "EventLevel": "INFO",
+        "Message": "Starting IaaS ScriptHandler Extension v1",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "5676",
+        "EventTid": "1",
+        "OperationId": "e1065def-7571-42c2-88a2-4f8b4c8f226d",
+        "TimeStamp": "2019-12-12T01:11:38.2298194Z",
+        "BadEvent": true
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "HandlerEnvironment = Version: 1, HandlerEnvironment: [LogFolder: \"C:\\WindowsAzure\\Logs\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\", ConfigFolder: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\RuntimeSettings\", StatusFolder: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\Status\", HeartbeatFile: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\Status\\HeartBeat.Json\"]",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "5676",
+        "EventTid": "1",
+        "OperationId": "e1065def-7571-42c2-88a2-4f8b4c8f226d",
+        "TimeStamp": "2019-12-12T01:11:38.2318168Z",
+        "BadEvent": true
+    }
+]
\ No newline at end of file
diff --git a/tests/data/events/extension_events/missing_parameters/1592273793.json b/tests/data/events/extension_events/missing_parameters/1592273793.json
new file mode 100644
index 00000000..3a7d3c2e
--- /dev/null
+++ b/tests/data/events/extension_events/missing_parameters/1592273793.json
@@ -0,0 +1,74 @@
+[
+    {
+      "EventLevel": "INFO",
+      "msg": "Random names for param keys should generate MissingKeyError, message missing",
+      "Version": "1",
+      "TaskName": "Downloading files",
+      "EventPid": "3228",
+      "EventTid": "1",
+      "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+      "TimeStamp": "2019-12-12T01:21:05.1960563Z",
+      "BadEvent": true
+    },
+    {
+      "EventLevel": "INFO",
+      "msg": "Random names for param keys should generate MissingKeyError, message missing",
+      "Version": "1",
+      "TaskName": "Downloading files",
+      "EventPid": "3228",
+      "EventTid": "1",
+      "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+      "TimeStamp": "2019-12-12T01:21:05.1960563Z",
+      "BadEvent": true
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "MissingKeyError: EventPid missing",
+        "Version": "1",
+        "TaskName": "Downloading files",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:21:05.1960563Z",
+        "BadEvent": true
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "MissingKeyError: EventPid missing",
+        "Version": "1",
+        "TaskName": "Downloading files",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:21:05.1960563Z",
+        "BadEvent": true
+    },
+  {
+      "EventLevel": "INFO",
+      "Message": "MissingKeyError: Version missing",
+      "TaskName": "Downloading files",
+      "EventPid": "3228",
+      "EventTid": "1",
+      "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+      "TimeStamp": "2019-12-12T01:21:05.1960563Z",
+      "BadEvent": true
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "MissingKeyError: Version missing",
+        "EventPid": "3228",
+        "TaskName": "Downloading files",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:21:05.1960563Z",
+        "BadEvent": true
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "MissingKeyError: Version missing",
+        "EventPid": "3228",
+        "TaskName": "Downloading files",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:21:05.1960563Z",
+        "BadEvent": true
+    }
+]
\ No newline at end of file
diff --git a/tests/data/events/extension_events/mix_files/1591835369.json b/tests/data/events/extension_events/mix_files/1591835369.json
new file mode 100644
index 00000000..5bb3d6cd
--- /dev/null
+++ b/tests/data/events/extension_events/mix_files/1591835369.json
@@ -0,0 +1,3 @@
+{
+  "BadEvent": true
+}
\ No newline at end of file
diff --git a/tests/data/events/extension_events/mix_files/1591835848.json b/tests/data/events/extension_events/mix_files/1591835848.json
new file mode 100644
index 00000000..d3a1f72b
--- /dev/null
+++ b/tests/data/events/extension_events/mix_files/1591835848.json
@@ -0,0 +1,85 @@
+[
+    {
+        "EventLevel": "INFO",
+        "Message": "Starting IaaS ScriptHandler Extension v1",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "HandlerEnvironment = Version: 1, HandlerEnvironment: [LogFolder: \"C:\\WindowsAzure\\Logs\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\", ConfigFolder: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\RuntimeSettings\", StatusFolder: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\Status\", HeartbeatFile: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\Status\\HeartBeat.Json\"]",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Comamnd Executed: enable",
+        "Version": "1",
+        "TaskName": "Handler Command",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Enabling Handler",
+        "Version": "1",
+        "TaskName": "Handler Operation",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Successfully enabled TLS.",
+        "Version": "1",
+        "TaskName": "TLS",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:05.1106498Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Handler successfully enabled",
+        "Version": "1",
+        "TaskName": "Handler Operation",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:05.1731503Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Loading configuration for sequence number 11",
+        "Version": "1",
+        "TaskName": "Sequence Number",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:05.1731503Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "HandlerSettings = ProtectedSettingsCertThumbprint: C8F2B56B0E79B592334BA0AFFFE172EB3DEF6753, ProtectedSettings: {MIIB0AYJKoZIhvcNAQcDoIIBwTCCAb0CAQAxggFpMIIBZQIBADBNMDkxNzA1BgoJkiaJk/IsZAEZFidXaW5kb3dzIEF6dXJlIENSUCBDZXJ0aWZpY2F0ZSBHZW5lcmF0b3ICEGPedX2PQQm0SE3jOKJHGtUwDQYJKoZIhvcNAQEBBQAEggEAqCIhARxqObDt9esAHszPzPonOyNyDpS2f/bsaA6TiZXyUg08JARIAZYAvR3TMJaH+Q3IkTC2tcQHmlBFVx7v9Dxm0RtwGM3CJve8Xq/Jf2X6gsq79nKPiFrZ1BRDp/TB6lZdC6ahIiRA+DOeL9p1wap8R7j67s+oQiEVi0nI0zqSOPH+nXsKNhi2xaW466zdgXdfsy2amp9pO/p9/mg+W/qyMFKcnFI8d26bqaWxYBQVYqxWnXSUE7Ul7hHEKyXQeF2QwE7QVBEMJIgLyx6u58M2FYtoWopU37gOMk8MWfTgIumP0WZOPHS/n6AffPgaypStiu9Q3HYTYnqH28OtjTBLBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECCzHZJQzFhdSgCgV25G1ZQKeyJPTLZu+u8bIjtPQ5yOOLFQZj8XrJj4HhQNTndIDwyNz}, PublicSettings: {}",
+        "Version": "1",
+        "TaskName": "Handler Configuration",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:16.7047734Z"
+    },
+    {
+        "BadEvent": true
+    }
+]
\ No newline at end of file
diff --git a/tests/data/events/extension_events/mix_files/1591835859.json b/tests/data/events/extension_events/mix_files/1591835859.json
new file mode 100644
index 00000000..c1999dfe
--- /dev/null
+++ b/tests/data/events/extension_events/mix_files/1591835859.json
@@ -0,0 +1,11 @@
+
+  {
+      "EventLevel": "INFO",
+      "Message": "Downloading files specified in configuration...",
+      "Version": "1",
+      "TaskName": "Downloading files",
+      "EventPid": "3228",
+      "EventTid": "1",
+      "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+      "TimeStamp": "2019-12-12T01:20:52.9247262Z"
+  }
diff --git a/tests/data/events/extension_events/special_chars/1591918939.json b/tests/data/events/extension_events/special_chars/1591918939.json
new file mode 100644
index 00000000..40c1bcdc
--- /dev/null
+++ b/tests/data/events/extension_events/special_chars/1591918939.json
@@ -0,0 +1,10 @@
+{
+        "EventLevel": "INFO",
+        "Message": "Non-English message -  此文字不是英文的",
+        "Version": "1",
+        "TaskName": "Downloading files",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OpErAtiOnID": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:21:05.1960563Z"
+}
\ No newline at end of file
diff --git a/tests/data/events/extension_events/well_formed_files/1591905451.json b/tests/data/events/extension_events/well_formed_files/1591905451.json
new file mode 100644
index 00000000..b5f3c3ef
--- /dev/null
+++ b/tests/data/events/extension_events/well_formed_files/1591905451.json
@@ -0,0 +1,82 @@
+[
+    {
+        "EventLevel": "INFO",
+        "Message": "Starting IaaS ScriptHandler Extension v1",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "HandlerEnvironment = Version: 1, HandlerEnvironment: [LogFolder: \"C:\\WindowsAzure\\Logs\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\", ConfigFolder: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\RuntimeSettings\", StatusFolder: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\Status\", HeartbeatFile: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\Status\\HeartBeat.Json\"]",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Comamnd Executed: enable",
+        "Version": "1",
+        "TaskName": "Handler Command",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Enabling Handler",
+        "Version": "1",
+        "TaskName": "Handler Operation",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Successfully enabled TLS.",
+        "Version": "1",
+        "TaskName": "TLS",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:05.1106498Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Handler successfully enabled",
+        "Version": "1",
+        "TaskName": "Handler Operation",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:05.1731503Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Loading configuration for sequence number 11",
+        "Version": "1",
+        "TaskName": "Sequence Number",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:05.1731503Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "HandlerSettings = ProtectedSettingsCertThumbprint: C8F2B56B0E79B592334BA0AFFFE172EB3DEF6753, ProtectedSettings: {MIIB0AYJKoZIhvcNAQcDoIIBwTCCAb0CAQAxggFpMIIBZQIBADBNMDkxNzA1BgoJkiaJk/IsZAEZFidXaW5kb3dzIEF6dXJlIENSUCBDZXJ0aWZpY2F0ZSBHZW5lcmF0b3ICEGPedX2PQQm0SE3jOKJHGtUwDQYJKoZIhvcNAQEBBQAEggEAqCIhARxqObDt9esAHszPzPonOyNyDpS2f/bsaA6TiZXyUg08JARIAZYAvR3TMJaH+Q3IkTC2tcQHmlBFVx7v9Dxm0RtwGM3CJve8Xq/Jf2X6gsq79nKPiFrZ1BRDp/TB6lZdC6ahIiRA+DOeL9p1wap8R7j67s+oQiEVi0nI0zqSOPH+nXsKNhi2xaW466zdgXdfsy2amp9pO/p9/mg+W/qyMFKcnFI8d26bqaWxYBQVYqxWnXSUE7Ul7hHEKyXQeF2QwE7QVBEMJIgLyx6u58M2FYtoWopU37gOMk8MWfTgIumP0WZOPHS/n6AffPgaypStiu9Q3HYTYnqH28OtjTBLBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECCzHZJQzFhdSgCgV25G1ZQKeyJPTLZu+u8bIjtPQ5yOOLFQZj8XrJj4HhQNTndIDwyNz}, PublicSettings: {}",
+        "Version": "1",
+        "TaskName": "Handler Configuration",
+        "EventPid": "3228",
+        "EventTid": "1",
+        "OperationId": "519e4beb-018a-4bd9-8d8e-c5226cf7f56e",
+        "TimeStamp": "2019-12-12T01:20:16.7047734Z"
+    }
+]
\ No newline at end of file
diff --git a/tests/data/events/extension_events/well_formed_files/1592355539.json b/tests/data/events/extension_events/well_formed_files/1592355539.json
new file mode 100644
index 00000000..8788ecec
--- /dev/null
+++ b/tests/data/events/extension_events/well_formed_files/1592355539.json
@@ -0,0 +1,72 @@
+[
+    {
+        "EventLevel": "INFO",
+        "Message": "Starting IaaS ScriptHandler Extension v1",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "5676",
+        "EventTid": "1",
+        "OperationId": "e1065def-7571-42c2-88a2-4f8b4c8f226d",
+        "Timestamp": "2019-12-12T01:11:38.2298194Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "HandlerEnvironment = Version: 1, HandlerEnvironment: [LogFolder: \"C:\\WindowsAzure\\Logs\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\", ConfigFolder: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\RuntimeSettings\", StatusFolder: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\Status\", HeartbeatFile: \"C:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.3\\Status\\HeartBeat.Json\"]",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "5676",
+        "EventTid": "1",
+        "OperationId": "e1065def-7571-42c2-88a2-4f8b4c8f226d",
+        "Timestamp": "2019-12-12T01:11:38.2318168Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Comamnd Executed: enable",
+        "Version": "1",
+        "TaskName": "Handler Command",
+        "EventPid": "5676",
+        "EventTid": "1",
+        "OperationId": "e1065def-7571-42c2-88a2-4f8b4c8f226d",
+        "Timestamp": "2019-12-12T01:11:38.2328180Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Enabling Handler",
+        "Version": "1",
+        "TaskName": "Handler Operation",
+        "EventPid": "5676",
+        "EventTid": "1",
+        "OperationId": "e1065def-7571-42c2-88a2-4f8b4c8f226d",
+        "Timestamp": "2019-12-12T01:11:38.2338180Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Successfully enabled TLS.",
+        "Version": "1",
+        "TaskName": "TLS",
+        "EventPid": "5676",
+        "EventTid": "1",
+        "OperationId": "e1065def-7571-42c2-88a2-4f8b4c8f226d",
+        "Timestamp": "2019-12-12T01:11:38.2368192Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Handler successfully enabled",
+        "Version": "1",
+        "TaskName": "Handler Operation",
+        "EventPid": "5676",
+        "EventTid": "1",
+        "OperationId": "e1065def-7571-42c2-88a2-4f8b4c8f226d",
+        "Timestamp": "2019-12-12T01:11:38.2448190Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "Loading configuration for sequence number 11",
+        "Version": "1",
+        "TaskName": "Sequence Number",
+        "EventPid": "5676",
+        "EventTid": "1",
+        "OperationId": "e1065def-7571-42c2-88a2-4f8b4c8f226d",
+        "Timestamp": "2019-12-12T01:11:38.2498176Z"
+    }
+]
\ No newline at end of file
diff --git a/tests/data/events/extension_events/well_formed_files/9999999999.json b/tests/data/events/extension_events/well_formed_files/9999999999.json
new file mode 100644
index 00000000..bd21a312
--- /dev/null
+++ b/tests/data/events/extension_events/well_formed_files/9999999999.json
@@ -0,0 +1,82 @@
+[
+    {
+        "EventLevel": "INFO",
+        "Message": "This is the latest event",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "999",
+        "EventTid": "999",
+        "OperationId": "",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "This is the latest event",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "999",
+        "EventTid": "999",
+        "OperationId": "",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "This is the latest event",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "999",
+        "EventTid": "999",
+        "OperationId": "",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "This is the latest event",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "999",
+        "EventTid": "999",
+        "OperationId": "",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "This is the latest event",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "999",
+        "EventTid": "999",
+        "OperationId": "",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "This is the latest event",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "999",
+        "EventTid": "999",
+        "OperationId": "",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "This is the latest event",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "999",
+        "EventTid": "999",
+        "OperationId": "",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    },
+    {
+        "EventLevel": "INFO",
+        "Message": "This is the latest event",
+        "Version": "1",
+        "TaskName": "Extension Info",
+        "EventPid": "999",
+        "EventTid": "999",
+        "OperationId": "",
+        "TimeStamp": "2019-12-12T01:20:05.0950244Z"
+    }
+]
\ No newline at end of file
diff --git a/tests/ga/test_extension.py b/tests/ga/test_extension.py
index 3ddeffff..a2425110 100644
--- a/tests/ga/test_extension.py
+++ b/tests/ga/test_extension.py
@@ -40,15 +40,14 @@ from azurelinuxagent.common.version import PY_VERSION_MAJOR, PY_VERSION_MINOR, P
     GOAL_STATE_AGENT_VERSION, CURRENT_VERSION, DISTRO_NAME, DISTRO_VERSION
 from azurelinuxagent.ga.exthandlers import ExtHandlerState, ExtHandlersHandler, ExtHandlerInstance, HANDLER_PKG_EXT, \
     migrate_handler_state, get_exthandlers_handler, AGENT_STATUS_FILE, ExtCommandEnvVariable, \
-    HandlerManifest, NOT_RUN, ValidHandlerStatus, HANDLER_NAME_PATTERN, HandlerEnvironment, ExtensionRequestedState
+    HandlerManifest, NOT_RUN, ValidHandlerStatus, HANDLER_COMPLETE_NAME_PATTERN, HandlerEnvironment, ExtensionRequestedState
 
 from azurelinuxagent.ga.monitor import get_monitor_handler
 from nose.plugins.attrib import attr
 from tests.protocol import mockwiredata
 from tests.protocol.mocks import mock_wire_protocol, HttpRequestPredicates
 from tests.protocol.mockwiredata import DATA_FILE
-from tests.tools import AgentTestCase, data_dir, i_am_root, MagicMock, Mock, patch
-
+from tests.tools import AgentTestCase, data_dir, i_am_root, MagicMock, Mock, patch, mock_sleep
 from azurelinuxagent.common.exception import ResourceGoneError, ExtensionDownloadError, ProtocolError, \
     ExtensionErrorCodes, ExtensionError, ExtensionUpdateError
 from azurelinuxagent.common.protocol.restapi import Extension, ExtHandlerProperties, ExtHandler, ExtHandlerStatus, \
@@ -63,10 +62,6 @@ SLEEP = time.sleep
 SUCCESS_CODE_FROM_STATUS_FILE = 1
 
 
-def mock_sleep(sec=0.01):
-    SLEEP(sec)
-
-
 def do_not_run_test():
     return True
 
@@ -104,7 +99,7 @@ class TestExtensionCleanup(AgentTestCase):
 
     @staticmethod
     def _is_extension_dir(path):
-        return re.match(HANDLER_NAME_PATTERN, os.path.basename(path)) is not None
+        return re.match(HANDLER_COMPLETE_NAME_PATTERN, os.path.basename(path)) is not None
 
     def _assert_ext_handler_status(self, aggregate_status, expected_status, version, expected_ext_handler_count=0):
         self.assertIsNotNone(aggregate_status, "Aggregate status should not be None")
diff --git a/tests/ga/test_extension_telemetry.py b/tests/ga/test_extension_telemetry.py
new file mode 100644
index 00000000..0095bbf5
--- /dev/null
+++ b/tests/ga/test_extension_telemetry.py
@@ -0,0 +1,538 @@
+import contextlib
+import glob
+import json
+import os
+import random
+import re
+import shutil
+import string
+import uuid
+from collections import defaultdict
+
+from mock import MagicMock, Mock, patch
+
+from azurelinuxagent.common import conf
+from azurelinuxagent.common.event import EVENTS_DIRECTORY
+from azurelinuxagent.common.exception import InvalidExtensionEventError
+from azurelinuxagent.common.future import ustr
+from azurelinuxagent.common.protocol.util import ProtocolUtil
+from azurelinuxagent.common.protocol.wire import event_param_to_v1
+from azurelinuxagent.common.telemetryevent import TelemetryEventParam, GuestAgentGenericLogsSchema, \
+    CommonTelemetryEventSchema
+from azurelinuxagent.common.utils import fileutil, textutil
+from azurelinuxagent.ga.extension_telemetry import ExtensionEventSchema, ProcessExtensionTelemetry
+from tests.protocol.mocks import mock_wire_protocol, HttpRequestPredicates, MockHttpResponse
+from tests.protocol.mockwiredata import DATA_FILE
+from tests.tools import AgentTestCase, clear_singleton_instances, data_dir, skip_if_predicate_true
+
+
+class TestExtensionTelemetryHandler(AgentTestCase, HttpRequestPredicates):
+
+    _TEST_DATA_DIR = os.path.join(data_dir, "events", "extension_events")
+    _WELL_FORMED_FILES = os.path.join(_TEST_DATA_DIR, "well_formed_files")
+    _MALFORMED_FILES = os.path.join(_TEST_DATA_DIR, "malformed_files")
+    _MIX_FILES = os.path.join(_TEST_DATA_DIR, "mix_files")
+
+    # To make tests more versatile, include this key in a test event to mark that event as a bad event.
+    # This event will then be skipped and will not be counted as a good event. This is purely for testing purposes,
+    # we use the good_event_count to validate the no of events the agent actually sends to Wireserver.
+    # Eg: {
+    #         "EventLevel": "INFO",
+    #         "Message": "Starting IaaS ScriptHandler Extension v1",
+    #         "Version": "1.2.3",
+    #         "TaskName": "Extension Info",
+    #         "EventPid": "5676",
+    #         "EventTid": "1",
+    #         "OperationId": "e1065def-7571-42c2-88a2-4f8b4c8f226d",
+    #         "TimeStamp": "2019-12-12T01:11:38.2298194Z",
+    #         "BadEvent": true
+    #     }
+    BAD_EVENT_KEY = 'BadEvent'
+
+    def setUp(self):
+        AgentTestCase.setUp(self)
+        clear_singleton_instances(ProtocolUtil)
+
+        # Create the log directory if not exists
+        fileutil.mkdir(conf.get_ext_log_dir())
+
+    def tearDown(self):
+        AgentTestCase.tearDown(self)
+
+
+    @staticmethod
+    def _parse_file_and_count_good_events(test_events_file_path):
+        if not os.path.exists(test_events_file_path):
+            raise OSError("Test Events file {0} not found".format(test_events_file_path))
+
+        try:
+            with open(test_events_file_path, "rb") as fd:
+                event_data = fd.read().decode("utf-8")
+
+            # Parse the string and get the list of events
+            events = json.loads(event_data)
+
+            if not isinstance(events, list):
+                events = [events]
+
+        except Exception as e:
+            print("Error parsing json file: {0}".format(e))
+            return 0
+
+        bad_key = TestExtensionTelemetryHandler.BAD_EVENT_KEY
+        return len([e for e in events if bad_key not in e or not e[bad_key]])
+
+    @staticmethod
+    def _create_random_extension_events_dir_with_events(no_of_extensions, events_path, no_of_chars=10):
+        if os.path.isdir(events_path):
+            # If its a directory, get all files from that directory
+            test_events_paths = glob.glob(os.path.join(events_path, "*"))
+        else:
+            test_events_paths = [events_path]
+
+        extension_names = {}
+        for i in range(no_of_extensions):
+            ext_name = "Microsoft.OSTCExtensions.{0}".format(''.join(random.sample(string.ascii_letters, no_of_chars)))
+            no_of_good_events = 0
+
+            for test_events_file_path in test_events_paths:
+                if not os.path.exists(test_events_file_path) or not os.path.isfile(test_events_file_path):
+                    continue
+                no_of_good_events += TestExtensionTelemetryHandler._parse_file_and_count_good_events(test_events_file_path)
+                events_dir = os.path.join(conf.get_ext_log_dir(), ext_name, EVENTS_DIRECTORY)
+                fileutil.mkdir(events_dir)
+                shutil.copy(test_events_file_path, events_dir)
+
+            extension_names[ext_name] = no_of_good_events
+
+        return extension_names
+
+    @staticmethod
+    def _get_no_of_events_from_body(body):
+        return body.count("</Event>")
+
+    @staticmethod
+    def _replace_in_file(file_path, replace_from, replace_to):
+
+        with open(file_path, 'r') as f:
+            content = f.read()
+
+        content = content.replace(replace_from, replace_to)
+
+        with open(file_path, 'w') as f:
+            f.write(content)
+
+    @staticmethod
+    def _get_handlers_with_version_from_event_body(event_body):
+        event_with_name_and_versions = defaultdict(list)
+        regex_pattern = r'<Param Name="EventName" Value="(.+?)-(.+?)" .* \/>'
+        for body in event_body:
+            body = TestExtensionTelemetryHandler._get_ustr_from_event_body(body)
+            xml_doc = textutil.parse_doc(body)
+            events = textutil.findall(xml_doc, "Event")
+
+            for event in events:
+                # Since this is a telemetry event, we should always have an EventName param in the event
+                handler_name, version = re.search(regex_pattern, event.childNodes[0].nodeValue).groups()
+                event_with_name_and_versions[handler_name].append(version)
+
+        return event_with_name_and_versions
+
+    @staticmethod
+    def _get_param_value_from_event_body_if_exists(event_body, param_name):
+        regex_pattern = r'<Param Name="{0}" Value=(\"|\')(?P<value>.+?)(\"|\') .* \/>'.format(param_name)
+        param_values = []
+
+        for body in event_body:
+            body = TestExtensionTelemetryHandler._get_ustr_from_event_body(body)
+            xml_doc = textutil.parse_doc(body)
+            events = textutil.findall(xml_doc, "Event")
+
+            for event in events:
+
+                regex = re.search(regex_pattern, event.childNodes[0].nodeValue)
+                if regex is None:
+                    continue
+                param_values.append(regex.group('value'))
+
+        return param_values
+
+
+    @contextlib.contextmanager
+    def _create_extension_telemetry_processor(self):
+
+        def http_post_handler(url, body, **__):
+            if self.is_telemetry_request(url):
+                extension_telemetry_processor.event_body.append(body)
+                return MockHttpResponse(status=200)
+            return None
+
+        with mock_wire_protocol(DATA_FILE, http_post_handler=http_post_handler) as protocol:
+            protocol_util = MagicMock()
+            protocol_util.get_protocol = Mock(return_value=protocol)
+            extension_telemetry_processor = ProcessExtensionTelemetry(protocol_util)
+            extension_telemetry_processor.event_body = []
+            yield extension_telemetry_processor
+
+    def _assert_handler_data_in_event_body(self, telemetry_events, ext_names_with_count, expected_count=None):
+
+        for ext_name, test_file_event_count in ext_names_with_count.items():
+            # If expected_count is not given, then the take the no of good events in the test file as the source of truth
+            count = expected_count if expected_count is not None else test_file_event_count
+            if count == 0:
+                self.assertNotIn(ext_name, telemetry_events,
+                                 "Found telemetry events for unwanted extension {0}".format(ext_name))
+                continue
+
+            self.assertIn(ext_name, telemetry_events,
+                          "Extension name: {0} not found in the Telemetry Events".format(ext_name))
+            self.assertEqual(len(telemetry_events[ext_name]), count,
+                             "No of good events for ext {0} do not match".format(ext_name))
+
+    def _assert_param_in_events(self, event_body, param_key, param_value, min_count=1):
+
+        param = TelemetryEventParam(param_key, param_value)
+        param_str = event_param_to_v1(param)
+        count = 0
+        for body in event_body:
+            body = TestExtensionTelemetryHandler._get_ustr_from_event_body(body)
+            if count >= min_count:
+                break
+            count += body.count(param_str)
+
+        self.assertGreaterEqual(count, min_count,
+                                "'{0}' param only found {1} times in events. Min_count required: {2}".format(param_str,
+                                                                                                             count,
+                                                                                                             min_count))
+    @staticmethod
+    def _get_ustr_from_event_body(body):
+        return body if (body is None or type(body) is ustr) else textutil.str_to_encoded_ustr(body)
+
+    @staticmethod
+    def _is_string_in_event_body(event_body, expected_string):
+        found = False
+        for body in event_body:
+            body = TestExtensionTelemetryHandler._get_ustr_from_event_body(body)
+            if expected_string in body:
+                found = True
+                break
+
+        return found
+
+    def test_it_should_not_capture_malformed_events(self):
+        with self._create_extension_telemetry_processor() as extension_telemetry_processor:
+            bad_name_ext_with_count = self._create_random_extension_events_dir_with_events(2, self._MALFORMED_FILES)
+            bad_json_ext_with_count = self._create_random_extension_events_dir_with_events(2, os.path.join(
+                self._MALFORMED_FILES, "bad_json_files", "1591816395.json"))
+
+            extension_telemetry_processor.run()
+            telemetry_events = self._get_handlers_with_version_from_event_body(extension_telemetry_processor.event_body)
+
+            self._assert_handler_data_in_event_body(telemetry_events, bad_name_ext_with_count, expected_count=0)
+            self._assert_handler_data_in_event_body(telemetry_events, bad_json_ext_with_count, expected_count=0)
+
+    def test_it_should_capture_and_send_correct_events(self):
+
+        with self._create_extension_telemetry_processor() as extension_telemetry_processor:
+
+            ext_names_with_count = self._create_random_extension_events_dir_with_events(2, self._WELL_FORMED_FILES)
+            ext_names_with_count.update(self._create_random_extension_events_dir_with_events(3, os.path.join(
+                self._MIX_FILES, "1591835859.json")))
+            extension_telemetry_processor.run()
+
+            telemetry_events = self._get_handlers_with_version_from_event_body(extension_telemetry_processor.event_body)
+
+            self._assert_handler_data_in_event_body(telemetry_events, ext_names_with_count)
+
+    def test_it_should_disregard_bad_events_and_keep_good_ones_in_a_mixed_file(self):
+        with self._create_extension_telemetry_processor() as extension_telemetry_processor:
+            extensions_with_count = self._create_random_extension_events_dir_with_events(2, self._MIX_FILES)
+            extensions_with_count.update(self._create_random_extension_events_dir_with_events(3, os.path.join(
+                self._MALFORMED_FILES, "bad_name_file.json")))
+
+            extension_telemetry_processor.run()
+            telemetry_events = self._get_handlers_with_version_from_event_body(extension_telemetry_processor.event_body)
+
+            self._assert_handler_data_in_event_body(telemetry_events, extensions_with_count)
+
+    def test_it_should_limit_max_no_of_events_to_send_per_run_per_extension_and_report_event(self):
+        max_events = 5
+        with patch("azurelinuxagent.ga.extension_telemetry.add_log_event") as mock_event:
+            with self._create_extension_telemetry_processor() as extension_telemetry_processor:
+                with patch.object(extension_telemetry_processor, "_MAX_NUMBER_OF_EVENTS_PER_EXTENSION_PER_PERIOD", max_events):
+                    ext_names_with_count = self._create_random_extension_events_dir_with_events(5, self._WELL_FORMED_FILES)
+                    extension_telemetry_processor.run()
+
+                    telemetry_events = self._get_handlers_with_version_from_event_body(extension_telemetry_processor.event_body)
+                    self._assert_handler_data_in_event_body(telemetry_events, ext_names_with_count, expected_count=max_events)
+
+                pattern = r'Reached max count for the extension:\s*(?P<name>.+?);\s*.+'
+                self._assert_event_reported(mock_event, ext_names_with_count, pattern)
+
+    def test_it_should_send_the_latest_events(self):
+        max_events = 5
+        no_of_extension = 2
+        test_guid = str(uuid.uuid4())
+
+        with self._create_extension_telemetry_processor() as extension_telemetry_processor:
+            with patch.object(extension_telemetry_processor, "_MAX_NUMBER_OF_EVENTS_PER_EXTENSION_PER_PERIOD", max_events):
+                ext_names_with_count = self._create_random_extension_events_dir_with_events(no_of_extension, self._WELL_FORMED_FILES)
+
+                for ext_name in ext_names_with_count.keys():
+                    self._replace_in_file(
+                        os.path.join(conf.get_ext_log_dir(), ext_name, EVENTS_DIRECTORY, "9999999999.json"),
+                        replace_from='"{0}": ""'.format(ExtensionEventSchema.OperationId),
+                        replace_to='"{0}": "{1}"'.format(ExtensionEventSchema.OperationId, test_guid))
+                extension_telemetry_processor.run()
+
+                telemetry_events = self._get_handlers_with_version_from_event_body(extension_telemetry_processor.event_body)
+                self._assert_handler_data_in_event_body(telemetry_events, ext_names_with_count,
+                                                        expected_count=max_events)
+                self._assert_param_in_events(extension_telemetry_processor.event_body,
+                                             param_key=GuestAgentGenericLogsSchema.Context1,
+                                             param_value="This is the latest event", min_count=no_of_extension*max_events)
+                self._assert_param_in_events(extension_telemetry_processor.event_body,
+                                             param_key=GuestAgentGenericLogsSchema.Context3, param_value=test_guid,
+                                             min_count=no_of_extension*max_events)
+
+
+    def test_it_should_parse_extension_event_irrespective_of_case(self):
+        with self._create_extension_telemetry_processor() as extension_telemetry_processor:
+            extensions_with_count = self._create_random_extension_events_dir_with_events(2, os.path.join(
+                self._TEST_DATA_DIR, "different_cases"))
+
+            extension_telemetry_processor.run()
+            telemetry_events = self._get_handlers_with_version_from_event_body(extension_telemetry_processor.event_body)
+
+            self._assert_handler_data_in_event_body(telemetry_events, extensions_with_count)
+
+    def test_it_should_parse_special_chars_properly(self):
+        with self._create_extension_telemetry_processor() as extension_telemetry_processor:
+            extensions_with_count = self._create_random_extension_events_dir_with_events(2, os.path.join(
+                self._TEST_DATA_DIR, "special_chars"))
+
+            extension_telemetry_processor.run()
+            telemetry_events = self._get_handlers_with_version_from_event_body(extension_telemetry_processor.event_body)
+
+            self._assert_handler_data_in_event_body(telemetry_events, extensions_with_count)
+
+    def _setup_and_assert_tests_for_max_sizes(self, no_of_extensions=2, expected_count=None):
+        with self._create_extension_telemetry_processor() as extension_telemetry_processor:
+            extensions_with_count = self._create_random_extension_events_dir_with_events(no_of_extensions,
+                                                                                         os.path.join(
+                                                                                             self._TEST_DATA_DIR,
+                                                                                             "large_messages"))
+
+            extension_telemetry_processor.run()
+            telemetry_events = self._get_handlers_with_version_from_event_body(extension_telemetry_processor.event_body)
+            self._assert_handler_data_in_event_body(telemetry_events, extensions_with_count, expected_count)
+
+            return extensions_with_count, extension_telemetry_processor.event_body
+
+    def _assert_invalid_extension_error_event_reported(self, mock_event, handler_name_with_count, error, expected_drop_count=None):
+
+        self.assertTrue(mock_event.called, "Even a single event not logged")
+        patt = r'Extension:\s+(?P<name>Microsoft.OSTCExtensions.+?);.+\s*Reason:\s+\[InvalidExtensionEventError\](?P<reason>.+?):.+Dropped Count:\s*(?P<count>\d+)'
+        for _, kwargs in mock_event.call_args_list:
+            msg = kwargs['message']
+            match = re.search(patt, msg, re.MULTILINE)
+            if match is not None:
+                self.assertEqual(match.group("reason").strip(), error, "Incorrect error")
+                self.assertIn(match.group("name"), handler_name_with_count, "Extension event not found")
+                count = handler_name_with_count.pop(match.group("name"))
+                count = expected_drop_count if expected_drop_count is not None else count
+                self.assertEqual(int(count), int(match.group("count")), "Dropped count doesnt match")
+
+        self.assertEqual(len(handler_name_with_count), 0, "All extension events not matched")
+
+    def _assert_event_reported(self, mock_event, handler_name_with_count, pattern):
+
+        self.assertTrue(mock_event.called, "Even a single event not logged")
+        for _, kwargs in mock_event.call_args_list:
+            msg = kwargs['message']
+            match = re.search(pattern, msg, re.MULTILINE)
+            if match is not None:
+                expected_handler_name = match.group("name")
+                self.assertIn(expected_handler_name, handler_name_with_count, "Extension event not found")
+                handler_name_with_count.pop(expected_handler_name)
+
+        self.assertEqual(len(handler_name_with_count), 0, "All extension events not matched")
+
+    def test_it_should_trim_message_if_more_than_limit(self):
+        max_len = 100
+        no_of_extensions = 2
+        with patch("azurelinuxagent.ga.extension_telemetry.ProcessExtensionTelemetry._EXTENSION_EVENT_MAX_MSG_LEN", max_len):
+            handler_name_with_count, event_body = self._setup_and_assert_tests_for_max_sizes()
+            context1_vals = self._get_param_value_from_event_body_if_exists(event_body,
+                                                                            GuestAgentGenericLogsSchema.Context1)
+            self.assertEqual(no_of_extensions, len(context1_vals),
+                             "There should be {0} Context1 values".format(no_of_extensions))
+
+            for val in context1_vals:
+                self.assertLessEqual(len(val), max_len, "Message Length does not match")
+
+    def test_it_should_skip_events_larger_than_max_size_and_report_event(self):
+        max_size = 1000
+        no_of_extensions = 3
+        with patch("azurelinuxagent.ga.extension_telemetry.add_log_event") as mock_event:
+            with patch("azurelinuxagent.ga.extension_telemetry.ProcessExtensionTelemetry._EXTENSION_EVENT_MAX_SIZE",
+                       max_size):
+                handler_name_with_count, _ = self._setup_and_assert_tests_for_max_sizes(no_of_extensions, expected_count=0)
+                self._assert_invalid_extension_error_event_reported(mock_event, handler_name_with_count,
+                                                                    error=InvalidExtensionEventError.OversizeEventError)
+
+    def test_it_should_skip_large_files_greater_than_max_file_size_and_report_event(self):
+        max_file_size = 10000
+        no_of_extensions = 5
+        with patch("azurelinuxagent.ga.extension_telemetry.add_log_event") as mock_event:
+            with patch("azurelinuxagent.ga.extension_telemetry.ProcessExtensionTelemetry._EXTENSION_EVENT_FILE_MAX_SIZE",
+                       max_file_size):
+                handler_name_with_count, _ = self._setup_and_assert_tests_for_max_sizes(no_of_extensions, expected_count=0)
+
+                pattern = r'Skipping file:\s*{0}/(?P<name>.+?)/{1}.+'.format(conf.get_ext_log_dir(), EVENTS_DIRECTORY)
+                self._assert_event_reported(mock_event, handler_name_with_count, pattern)
+
+    def test_it_should_map_extension_event_json_correctly_to_telemetry_event(self):
+
+        # EventName maps to HandlerName + '-' + Version from event file
+        expected_mapping = {
+            GuestAgentGenericLogsSchema.EventName: ExtensionEventSchema.Version,
+            GuestAgentGenericLogsSchema.CapabilityUsed: ExtensionEventSchema.EventLevel,
+            GuestAgentGenericLogsSchema.TaskName: ExtensionEventSchema.TaskName,
+            GuestAgentGenericLogsSchema.Context1: ExtensionEventSchema.Message,
+            GuestAgentGenericLogsSchema.Context2: ExtensionEventSchema.Timestamp,
+            GuestAgentGenericLogsSchema.Context3: ExtensionEventSchema.OperationId,
+            CommonTelemetryEventSchema.EventPid: ExtensionEventSchema.EventPid,
+            CommonTelemetryEventSchema.EventTid: ExtensionEventSchema.EventTid
+        }
+
+        with self._create_extension_telemetry_processor() as extension_telemetry_processor:
+            test_file = os.path.join(self._WELL_FORMED_FILES, "1592355539.json")
+            handler_name = list(self._create_random_extension_events_dir_with_events(1, test_file))[0]
+            extension_telemetry_processor.run()
+
+            telemetry_event_map = defaultdict(list)
+            for telemetry_event_key in expected_mapping:
+                telemetry_event_map[telemetry_event_key] = self._get_param_value_from_event_body_if_exists(
+                    extension_telemetry_processor.event_body, telemetry_event_key)
+
+            with open(test_file, 'r') as event_file:
+                data = json.load(event_file)
+
+            extension_event_map = defaultdict(list)
+            for extension_event in data:
+                for event_key in extension_event:
+                    extension_event_map[event_key].append(extension_event[event_key])
+
+            for telemetry_key in expected_mapping:
+                extension_event_key = expected_mapping[telemetry_key]
+                telemetry_data = telemetry_event_map[telemetry_key]
+
+                # EventName = "HandlerName-Version" from Extensions
+                extension_data = ["{0}-{1}".format(handler_name, v) for v in extension_event_map[
+                    extension_event_key]] if telemetry_key == GuestAgentGenericLogsSchema.EventName else \
+                extension_event_map[extension_event_key]
+
+                self.assertEqual(telemetry_data, extension_data,
+                                 "The data for {0} and {1} doesn't map properly".format(telemetry_key,
+                                                                                        extension_event_key))
+
+    def test_it_should_always_cleanup_files_on_good_and_bad_cases(self):
+        with self._create_extension_telemetry_processor() as extension_telemetry_processor:
+            extensions_with_count = self._create_random_extension_events_dir_with_events(2, os.path.join(
+                self._TEST_DATA_DIR, "large_messages"))
+            extensions_with_count.update(self._create_random_extension_events_dir_with_events(3, self._MALFORMED_FILES))
+            extensions_with_count.update(self._create_random_extension_events_dir_with_events(4, self._WELL_FORMED_FILES))
+            extensions_with_count.update(self._create_random_extension_events_dir_with_events(1, self._MIX_FILES))
+
+            # Create random files in the events directory for each extension just to ensure that we delete them later
+            for handler_name in extensions_with_count.keys():
+                file_name = os.path.join(conf.get_ext_log_dir(), handler_name, EVENTS_DIRECTORY,
+                                         ''.join(random.sample(string.ascii_letters, 10)))
+                with open(file_name, 'a') as random_file:
+                    random_file.write('1*2*3' * 100)
+
+            extension_telemetry_processor.run()
+            telemetry_events = self._get_handlers_with_version_from_event_body(extension_telemetry_processor.event_body)
+
+            self._assert_handler_data_in_event_body(telemetry_events, extensions_with_count)
+
+            for handler_name in extensions_with_count.keys():
+                events_path = os.path.join(conf.get_ext_log_dir(), handler_name, EVENTS_DIRECTORY)
+                self.assertTrue(os.path.exists(events_path), "{0} dir doesn't exist".format(events_path))
+                self.assertEqual(0, len(os.listdir(events_path)), "There should be no files inside the events dir")
+
+    def test_it_should_skip_unwanted_parameters_in_event_file(self):
+        extra_params = ["SomethingNewButNotCool", "SomethingVeryWeird"]
+        param_format = '<Param Name="{0}"'
+        with self._create_extension_telemetry_processor() as extension_telemetry_processor:
+            extensions_with_count= self._create_random_extension_events_dir_with_events(3, os.path.join(
+                self._TEST_DATA_DIR, "extra_parameters"))
+
+            extension_telemetry_processor.run()
+            telemetry_events = self._get_handlers_with_version_from_event_body(extension_telemetry_processor.event_body)
+
+            self._assert_handler_data_in_event_body(telemetry_events, extensions_with_count)
+            self.assertFalse(self._is_string_in_event_body(extension_telemetry_processor.event_body,
+                                                           param_format.format(extra_params[0])),
+                             "Unwanted param {0} found".format(extra_params[0]))
+            self.assertFalse(self._is_string_in_event_body(extension_telemetry_processor.event_body,
+                                                           param_format.format(extra_params[1])),
+                             "Unwanted param {0} found".format(extra_params[1]))
+
+    def test_it_should_not_send_events_which_dont_have_all_required_keys_and_report_event(self):
+        with patch("azurelinuxagent.ga.extension_telemetry.add_log_event") as mock_event:
+            with self._create_extension_telemetry_processor() as extension_telemetry_processor:
+                extensions_with_count = self._create_random_extension_events_dir_with_events(3, os.path.join(
+                    self._TEST_DATA_DIR, "missing_parameters"))
+
+                extension_telemetry_processor.run()
+                telemetry_events = self._get_handlers_with_version_from_event_body(extension_telemetry_processor.event_body)
+
+                self._assert_handler_data_in_event_body(telemetry_events, extensions_with_count, expected_count=0)
+                self.assertTrue(mock_event.called, "Even a single event not logged")
+
+                for _, kwargs in mock_event.call_args_list:
+                    # Example:
+                    #['Dropped events for Extension: Microsoft.OSTCExtensions.ZJQRNqbKtP; Details:',
+                    # 'Reason: [InvalidExtensionEventError] MissingKeyError: eventpid not found; Dropped Count: 2',
+                    # 'Reason: [InvalidExtensionEventError] MissingKeyError: Message not found; Dropped Count: 2',
+                    # 'Reason: [InvalidExtensionEventError] MissingKeyError: version not found; Dropped Count: 3']
+                    msg = kwargs['message'].split("\n")
+                    ext_name = re.search(r'Dropped events for Extension:\s+(?P<name>Microsoft.OSTCExtensions.+?);.+', msg.pop(0))
+                    if ext_name is not None:
+                        ext_name = ext_name.group('name')
+                        self.assertIn(ext_name, extensions_with_count, "Extension {0} not found".format(ext_name))
+                        patt = r'\s*Reason:\s+\[InvalidExtensionEventError\](?P<reason>.+?):\s*(?P<key>.+?)\s+not found;\s+Dropped Count:\s*(?P<count>\d+)'
+                        expected_error_drop_count = {
+                            ExtensionEventSchema.EventPid.lower(): 2,
+                            ExtensionEventSchema.Message.lower(): 2,
+                            ExtensionEventSchema.Version.lower(): 3
+                        }
+                        for m in msg:
+                            match = re.search(patt, m)
+                            self.assertIsNotNone(match, "No InvalidExtensionEventError errors reported")
+                            self.assertEqual(match.group("reason").strip(), InvalidExtensionEventError.MissingKeyError,
+                                             "Error is not a {0}".format(InvalidExtensionEventError.MissingKeyError))
+                            observerd_error = match.group("key").lower()
+                            self.assertIn(observerd_error, expected_error_drop_count, "Unexpected error reported")
+                            self.assertEqual(expected_error_drop_count.pop(observerd_error), int(match.group("count")),
+                                             "Unequal no of dropped events")
+                        self.assertEqual(len(expected_error_drop_count), 0, "All errros not found yet")
+                        del extensions_with_count[ext_name]
+
+                self.assertEqual(len(extensions_with_count), 0, "All extension events not matched")
+
+    def test_it_should_not_send_event_where_message_is_empty_and_report_event(self):
+        with patch("azurelinuxagent.ga.extension_telemetry.add_log_event") as mock_event:
+            with self._create_extension_telemetry_processor() as extension_telemetry_processor:
+                extensions_with_count = self._create_random_extension_events_dir_with_events(3, os.path.join(
+                    self._TEST_DATA_DIR, "empty_message"))
+
+                extension_telemetry_processor.run()
+                telemetry_events = self._get_handlers_with_version_from_event_body(extension_telemetry_processor.event_body)
+
+                self._assert_handler_data_in_event_body(telemetry_events, extensions_with_count, expected_count=0)
+                self._assert_invalid_extension_error_event_reported(mock_event, extensions_with_count,
+                                                                    InvalidExtensionEventError.EmptyMessageError,
+                                                                    expected_drop_count=1)
\ No newline at end of file
diff --git a/tests/ga/test_update.py b/tests/ga/test_update.py
index e0217e92..21987ddc 100644
--- a/tests/ga/test_update.py
+++ b/tests/ga/test_update.py
@@ -1254,8 +1254,8 @@ class TestUpdate(UpdateTestCase):
 
         with patch('azurelinuxagent.ga.exthandlers.get_exthandlers_handler') as mock_handler:
             with patch('azurelinuxagent.ga.remoteaccess.get_remote_access_handler') as mock_ra_handler:
-                with patch('azurelinuxagent.ga.monitor.get_monitor_handler') as mock_monitor:
-                    with patch('azurelinuxagent.ga.env.get_env_handler') as mock_env:
+                with patch('azurelinuxagent.ga.update.get_monitor_handler') as mock_monitor:
+                    with patch('azurelinuxagent.ga.update.get_env_handler') as mock_env:
                         with patch('azurelinuxagent.ga.update.initialize_event_logger_vminfo_common_parameters'):
                             with patch('time.sleep', side_effect=iterator) as mock_sleep:
                                 with patch('sys.exit') as mock_exit:
@@ -1599,6 +1599,8 @@ class TestUpdate(UpdateTestCase):
                     self.assertTrue(os.path.exists(ext_dir), "Extension directory {0} should exist!".format(ext_dir))
 
 
+@patch('azurelinuxagent.ga.update.get_monitor_handler')
+@patch('azurelinuxagent.ga.update.get_env_handler')
 class MonitorThreadTest(AgentTestCase):
     def setUp(self):
         AgentTestCase.setUp(self)
@@ -1628,8 +1630,18 @@ class MonitorThreadTest(AgentTestCase):
                                     with patch('sys.exit'):
                                         self.update_handler.run()
 
-    @patch('azurelinuxagent.ga.monitor.get_monitor_handler')
-    @patch('azurelinuxagent.ga.env.get_env_handler')
+    def _setup_mock_thread_and_start_test_run(self, mock_thread, is_alive=True, invocations=0):
+        self.assertTrue(self.update_handler.running)
+
+        thread = MagicMock()
+        thread.run = MagicMock()
+        thread.is_alive = MagicMock(return_value=is_alive)
+        thread.start = MagicMock()
+        mock_thread.return_value = thread
+
+        self._test_run(invocations=invocations)
+        return thread
+
     def test_start_threads(self, mock_env, mock_monitor):
         self.assertTrue(self.update_handler.running)
 
@@ -1647,103 +1659,43 @@ class MonitorThreadTest(AgentTestCase):
         self.assertEqual(1, mock_env.call_count)
         self.assertEqual(1, mock_env_thread.run.call_count)
 
-    @patch('azurelinuxagent.ga.monitor.get_monitor_handler')
-    @patch('azurelinuxagent.ga.env.get_env_handler')
     def test_check_if_monitor_thread_is_alive(self, mock_env, mock_monitor):
-        self.assertTrue(self.update_handler.running)
-
-        mock_monitor_thread = MagicMock()
-        mock_monitor_thread.run = MagicMock()
-        mock_monitor_thread.is_alive = MagicMock(return_value=True)
-        mock_monitor_thread.start = MagicMock()
-        mock_monitor.return_value = mock_monitor_thread
-
-        self._test_run(invocations=0)
+        mock_monitor_thread = self._setup_mock_thread_and_start_test_run(mock_monitor, is_alive=True, invocations=0)
         self.assertEqual(1, mock_monitor.call_count)
         self.assertEqual(1, mock_monitor_thread.run.call_count)
         self.assertEqual(1, mock_monitor_thread.is_alive.call_count)
         self.assertEqual(0, mock_monitor_thread.start.call_count)
 
-    @patch('azurelinuxagent.ga.monitor.get_monitor_handler')
-    @patch('azurelinuxagent.ga.env.get_env_handler')
     def test_check_if_env_thread_is_alive(self, mock_env, mock_monitor):
-        self.assertTrue(self.update_handler.running)
-
-        mock_env_thread = MagicMock()
-        mock_env_thread.run = MagicMock()
-        mock_env_thread.is_alive = MagicMock(return_value=True)
-        mock_env_thread.start = MagicMock()
-        mock_env.return_value = mock_env_thread
-
-        self._test_run(invocations=1)
+        mock_env_thread = self._setup_mock_thread_and_start_test_run(mock_env, is_alive=True, invocations=1)
         self.assertEqual(1, mock_env.call_count)
         self.assertEqual(1, mock_env_thread.run.call_count)
         self.assertEqual(1, mock_env_thread.is_alive.call_count)
         self.assertEqual(0, mock_env_thread.start.call_count)
 
-    @patch('azurelinuxagent.ga.monitor.get_monitor_handler')
-    @patch('azurelinuxagent.ga.env.get_env_handler')
     def test_restart_monitor_thread_if_not_alive(self, mock_env, mock_monitor):
-        self.assertTrue(self.update_handler.running)
-
-        mock_monitor_thread = MagicMock()
-        mock_monitor_thread.run = MagicMock()
-        mock_monitor_thread.is_alive = MagicMock(return_value=False)
-        mock_monitor_thread.start = MagicMock()
-        mock_monitor.return_value = mock_monitor_thread
-
-        self._test_run(invocations=1)
+        mock_monitor_thread = self._setup_mock_thread_and_start_test_run(mock_monitor, is_alive=False, invocations=1)
         self.assertEqual(1, mock_monitor.call_count)
         self.assertEqual(1, mock_monitor_thread.run.call_count)
         self.assertEqual(1, mock_monitor_thread.is_alive.call_count)
         self.assertEqual(1, mock_monitor_thread.start.call_count)
 
-    @patch('azurelinuxagent.ga.monitor.get_monitor_handler')
-    @patch('azurelinuxagent.ga.env.get_env_handler')
     def test_restart_env_thread_if_not_alive(self, mock_env, mock_monitor):
-        self.assertTrue(self.update_handler.running)
-
-        mock_env_thread = MagicMock()
-        mock_env_thread.run = MagicMock()
-        mock_env_thread.is_alive = MagicMock(return_value=False)
-        mock_env_thread.start = MagicMock()
-        mock_env.return_value = mock_env_thread
-
-        self._test_run(invocations=1)
+        mock_env_thread = self._setup_mock_thread_and_start_test_run(mock_env, is_alive=False, invocations=1)
         self.assertEqual(1, mock_env.call_count)
         self.assertEqual(1, mock_env_thread.run.call_count)
         self.assertEqual(1, mock_env_thread.is_alive.call_count)
         self.assertEqual(1, mock_env_thread.start.call_count)
 
-    @patch('azurelinuxagent.ga.monitor.get_monitor_handler')
-    @patch('azurelinuxagent.ga.env.get_env_handler')
     def test_restart_monitor_thread(self, mock_env, mock_monitor):
-        self.assertTrue(self.update_handler.running)
-
-        mock_monitor_thread = MagicMock()
-        mock_monitor_thread.run = MagicMock()
-        mock_monitor_thread.is_alive = MagicMock(return_value=False)
-        mock_monitor_thread.start = MagicMock()
-        mock_monitor.return_value = mock_monitor_thread
-
-        self._test_run(invocations=0)
+        mock_monitor_thread = self._setup_mock_thread_and_start_test_run(mock_monitor, is_alive=False, invocations=0)
         self.assertEqual(True, mock_monitor.called)
         self.assertEqual(True, mock_monitor_thread.run.called)
         self.assertEqual(True, mock_monitor_thread.is_alive.called)
         self.assertEqual(True, mock_monitor_thread.start.called)
 
-    @patch('azurelinuxagent.ga.monitor.get_monitor_handler')
-    @patch('azurelinuxagent.ga.env.get_env_handler')
     def test_restart_env_thread(self, mock_env, mock_monitor):
-        self.assertTrue(self.update_handler.running)
-
-        mock_env_thread = MagicMock()
-        mock_env_thread.run = MagicMock()
-        mock_env_thread.is_alive = MagicMock(return_value=False)
-        mock_env_thread.start = MagicMock()
-        mock_env.return_value = mock_env_thread
-
-        self._test_run(invocations=0)
+        mock_env_thread = self._setup_mock_thread_and_start_test_run(mock_env, is_alive=False, invocations=0)
         self.assertEqual(True, mock_env.called)
         self.assertEqual(True, mock_env_thread.run.called)
         self.assertEqual(True, mock_env_thread.is_alive.called)