2

I made a normal bot by using Microsoft Bot Framework and have deployed it to the Azure portal. I tried to channel the bot to Teams, which worked but the bot couldn’t receive attachments. How can I make it do so?

Thanks.

  • You really have two questions here and should consider either splitting this or making it a question just on how to handle attachments. In general you do NOT need to modify your bot code to deploy your bot to teams (some channel specific functionality may be desired but is generally not required). None of my Teams bots use TeamsActivityHandler and all work fine EXCEPT for dealing with attachments. I have not gotten a satisfactory answer on that in my searches and attempts thus far unfortunately. – billoverton Feb 23 '21 at 02:57
  • Can you please share manifest here this will help me to repro issue at my end and take it further. – Mamatha-MSFT Feb 23 '21 at 05:56
  • Unfortunately I don't have a Teams app so cannot send manifest. What I have is a Web App Bot on Azure, which can be channeled to Teams but without the function to receive attachments, could you help with this issue? – mechabunny19c Feb 23 '21 at 15:54
  • Microsoft Teams does not allow attachments by default. To send and receive files in the bot in teams, set the supportsFiles property in the manifest to true or else create an app for your bot in App studio. Specify your app allows upload attachments. And install it in your own Team account for testing. Please look at this [sample code](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/56.teams-file-upload) for reference. – Mamatha-MSFT Feb 25 '21 at 07:18
  • @mechabunny19c, please let us know if your issue has been resolved. – Mamatha-MSFT Mar 03 '21 at 04:30

1 Answers1

1

Microsoft Teams does not allow attachments by default. To send and receive files in the bot in teams, set the supportsFiles property in the manifest to true or else create an app for your bot in App studio. Specify your app allows upload attachments. And install it in your own Team account for testing. Please look at this sample code for reference.

Mamatha-MSFT
  • 577
  • 3
  • 4
  • Thanks for clarifying that. So, one quick question, if I already had a normal bot (web app bot) deployed on Azure and I want to turn it to a Teams app, do I need to modify the bot src? if so, to want extent should it be modified? – mechabunny19c Mar 04 '21 at 05:40
  • Yes, you need to change attachment receive code in OnMessageActivityAsync(). Please go through the above mentioned sample code. – Mamatha-MSFT Mar 04 '21 at 10:00