Operation returned an invalid status code 'BadRequest'
See original GitHub issueGithub 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:
- Created 4 years ago
- Comments:10 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I fixed same problem with removing empty contents in my json text.
@exdunn thank you so much bro…this actually saved my time debugging the entire code