question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Operation returned an invalid status code 'BadRequest'

See original GitHub issue

Github issues should be used for bugs and feature requests. Use Stack Overflow for general “how-to” questions.

Version

Latest v4 SDK

Describe the bug

I am using a simple Adaptive Card to display an image using base64 encoded image value. It works fine on my local workstation with Bot Emulator. When I deploy this to Azure App Service I get an error.

To Reproduce

Here’s my JSON with shorted base64. For full JSON and original image see attachment.

{
  "type": "AdaptiveCard",
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "version": "1.0",
  "body": [
    {
      "type": "Image",
      "url": "data:image/png;base64,iVBORw0KGgoAAAANS....ggg=="
    }
  ]
}

On Azure I get the following error:

Microsoft.Bot.Schema.ErrorResponseException: Operation returned an invalid status code 'BadRequest'
  at Microsoft.Bot.Connector.Conversations.ReplyToActivityWithHttpMessagesAsync(String conversationId, String activityId, Activity activity, Dictionary`2 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__DisplayClass22_0.<<SendActivitiesAsync>g__SendActivitiesThroughAdapter|1>d.MoveNext()

Expected behavior

Image is displayed

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

If I try to dispay image via URL it works just fine.

[bug]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
fknincecommented, Jun 17, 2020

I fixed same problem with removing empty contents in my json text.

0reactions
jnair7291commented, Jul 16, 2021

@exdunn thank you so much bro…this actually saved my time debugging the entire code

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure – Operation returned an invalid status code 'BadRequest'
The error message was not explicit because the status code indicated: 'Bad Request'. I switched to the Azure Portal and tried to create...
Read more >
Operation returned an invalid status code 'BadRequest'
Solved: I tried to use RLS with PowerBi embedded analytics. I followed steps from Using row-level security with embedded content in Power BI ......
Read more >
Azure Powershell : Operation returned an invalid status code ...
While working on few Azure Powershell scripts I was keep receiving an error 'BadRequest' whenever I was trying to create a new resource...
Read more >
Handle Error: Operation returned an invalid status code ...
The error occurs when it is trying to add the items to the queue: Handle Error: Operation returned an invalid status code 'BadRequest'....
Read more >
Operation returned an invalid status 'Bad Request' when ...
Describe the bug. To Reproduce. Run az staticwebapp hostname set -n jamcloud --hostname blog.domain.com returns Operation returned an ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found