Repository: microsoft/botbuilder-python (python)

Issue:
Incorrect channel_data data type in TelemetryLoggerMiddleware
## Version
4.14

## Describe the bug
Channel data from Teams are incorrectly used in Telemetry Middleware. Bot is not able to respond to any message sent via Teams when the Telemetry is enabled. The same bot works fine when tested in Bot Framework Emulator.

## To Reproduce
Steps to reproduce the behavior:
1. Add Telemetry to your Python Bot:
```
TELEMETRY_CLIENT = ApplicationInsightsTelemetryClient(
    CONFIG.APPINSIGHTS_INSTRUMENTATION_KEY, telemetry_processor=AiohttpTelemetryProcessor(), client_queue_size=1
)
TELEMETRY_LOGGER_MIDDLEWARE = TelemetryLoggerMiddleware(TELEMETRY_CLIENT, True)
ADAPTER.use(TELEMETRY_LOGGER_MIDDLEWARE)
...
APP = web.Application(middlewares=[bot_telemetry_middleware, aiohttp_error_middleware])
```
2. Deploy to Azure and connect to Teams
3. Send a message from Teams to the bot.
4. See error:
```
2022-04-21T10:55:29.178590260Z     TelemetryLoggerMiddleware.__populate_additional_channel_properties(
2022-04-21T10:55:29.178594560Z   File "/usr/local/lib/python3.8/site-packages/botbuilder/core/telemetry_logger_middleware.py", line 307, in __populate_additional_channel_properties
2022-04-21T10:55:29.178599160Z     if teams_channel_data and teams_channel_data.tenant
2022-04-21T10:55:29.178603361Z AttributeError: 'dict' object has no attribute 'tenant'
```

## Additional context
I have found out that `activity.channel_data` is a dict, not an object. Therefore, I changed the following method in `telemetry_logger_middleware.py` to use the dict instead of the object and now it works fine. 
```
    @staticmethod
    def __populate_additional_channel_properties(
        activity: Activity, properties: dict,
    ):
        if activity.channel_id == Channels.ms_teams:
            teams_channel_data: TeamsChannelData = activity.channel_data

            properties["TeamsTenantId"] = (
                teams_channel_data['tenant']['id']
                if teams_channel_data and teams_channel_data.get("tenant", {}).get("id", None)
                else ""
            )

            properties["TeamsUserAadObjectId"] = (
                activity.from_property.aad_object_id if activity.from_property else ""
            )

            if teams_channel_data and teams_channel_data.get("team", None):
                properties["TeamsTeamInfo"] = TeamInfo.serialize(
                    teams_channel_data['team']
                )
```


Pull request:
Corrected TeamsChannelData deserialization in TelemetryLoggerMiddleware
Fixes #1935 

Patch:
diff --git a/libraries/botbuilder-core/botbuilder/core/telemetry_logger_middleware.py b/libraries/botbuilder-core/botbuilder/core/telemetry_logger_middleware.py
index 711ddb88..7f65d95d 100644
--- a/libraries/botbuilder-core/botbuilder/core/telemetry_logger_middleware.py
+++ b/libraries/botbuilder-core/botbuilder/core/telemetry_logger_middleware.py
@@ -303,10 +303,12 @@ class TelemetryLoggerMiddleware(Middleware):
         properties: dict,
     ):
         if activity.channel_id == Channels.ms_teams:
-            teams_channel_data: TeamsChannelData = activity.channel_data
+            teams_channel_data: TeamsChannelData = TeamsChannelData().deserialize(
+                activity.channel_data
+            )
 
             properties["TeamsTenantId"] = (
-                teams_channel_data.tenant
+                teams_channel_data.tenant.id
                 if teams_channel_data and teams_channel_data.tenant
                 else ""
             )
diff --git a/libraries/botbuilder-dialogs/setup.py b/libraries/botbuilder-dialogs/setup.py
index ed6dbd5b..6e97715a 100644
--- a/libraries/botbuilder-dialogs/setup.py
+++ b/libraries/botbuilder-dialogs/setup.py
@@ -6,6 +6,7 @@ from setuptools import setup
 
 REQUIRES = [
     "regex<=2019.08.19",
+    "emoji==1.7.0",
     "recognizers-text-date-time>=1.0.2a1",
     "recognizers-text-number-with-unit>=1.0.2a1",
     "recognizers-text-number>=1.0.2a1",


Test patch:
diff --git a/libraries/botbuilder-core/tests/test_telemetry_middleware.py b/libraries/botbuilder-core/tests/test_telemetry_middleware.py
index 3df51b9a..ee3504d1 100644
--- a/libraries/botbuilder-core/tests/test_telemetry_middleware.py
+++ b/libraries/botbuilder-core/tests/test_telemetry_middleware.py
@@ -251,7 +251,7 @@ class TestTelemetryMiddleware(aiounittest.AsyncTestCase):
         channel_data = TeamsChannelData(
             team=team_info,
             tenant=TenantInfo(id="tenantId"),
-        )
+        ).serialize()
 
         activity = MessageFactory.text("test")
         activity.channel_data = channel_data
@@ -272,7 +272,7 @@ class TestTelemetryMiddleware(aiounittest.AsyncTestCase):
                     "fromId": "userId",
                     "recipientId": "bot",
                     "recipientName": "Bot",
-                    "TeamsTenantId": TenantInfo(id="tenantId"),
+                    "TeamsTenantId": "tenantId",
                     "TeamsUserAadObjectId": "aaId",
                     "TeamsTeamInfo": TeamInfo.serialize(team_info),
                 },