1

I am creating a bot that needs to return a csv file from an azure storage blob as a response (i.e. give me a listing of all users and email addresses). When I run the request in the bot framework emulator it works great, but when trying in teams (which will be used for the chatbot) I get the following error.

Operation returned an invalid status code 'BadRequest' at Microsoft.Bot.Connector.Conversations.ReplyToActivityWithHttpMessagesAsync(String conversationId, String activityId, Activity activity, Dictionary2 customHeaders, CancellationToken cancellationToken) at Microsoft.Bot.Connector.ConversationsExtensions.ReplyToActivityAsync(IConversations operations, String conversationId, String activityId, Activity activity, CancellationToken cancellationToken) at Microsoft.Bot.Builder.BotFrameworkAdapter.SendActivitiesAsync(ITurnContext turnContext, Activity[] activities, CancellationToken cancellationToken) at Microsoft.Bot.Builder.TurnContext.<>c__DisplayClass25_0.<g__SendActivitiesThroughAdapter|1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.Bot.Builder.TurnContext.SendActivityAsync(IActivity activity, CancellationToken cancellationToken).

Here is the part where I an attaching the file to the message.

var message = MessageFactory.Text(noOfUsersFoundText, noOfUsersFound, InputHints.IgnoringInput);
message.Attachments.Add(new Attachment
{
    Name = fileName,
    ContentType = "text/csv",
    ContentUrl = fileUrl
});
await stepContext.Context.SendActivityAsync(message, cancellationToken);

Has any one gotten this to work?

UPDATE: This is from the App Studio Editor in teams.

enter image description here

4
  • Could you please make sure if you have allowed "supportFiles" to true for your Bot? Commented Apr 8, 2020 at 9:20
  • Are you sure the "fileUrl" has correct value? Commented Apr 8, 2020 at 11:07
  • fileUrl is set to the link for the file in Azure, I have supportFiles set on App Studio app for teams. I've read that there is a place to set it in the manifest, but my program doesn't have a manifest file. Commented Apr 8, 2020 at 12:05
  • Also in Visual Studio 2019, I can't find a place to add the application manifest Commented Apr 8, 2020 at 13:19

1 Answer 1

0

Ok from what I read, only image files can be used as attachments. So I went with sending a hero card to the url. And that seems to work.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.