Azure Blob Upload Failed – StatusCode 400

I use Azure blob storage to host a static web site. Today, as I do every week, I tried to upload an MP3 file using Azure Storage Explorer. The upload and a retry failed. So I attempted the upload from the Azure web portal. This failed with the message, “Upload block blob to blob store failed. Details: StatusCode = 400, StatusText = The specified blob or block content is invalid.”

Azure Error 1

I played the MP3 file locally. It worked fine; there is nothing wrong with the file.

Could it be a file access error? I copied the file to my desktop and tried to upload. That also failed.

I created a small test.txt file and uploaded it. That worked fine. So the container is functioning.

I tried to research the error and was quickly sucked into a vortex of complex causes and solutions like those in this article:  block IDs lengths, how to split blobs, programs you can write to check or fix the issue, waiting seven days to see if the uncommitted blocks are purged, etc. Good grief. I just want to upload an 11MB MP3 file! I envisioned a long Azure support process trying to get this resolved.

Rename, Then Upload

On a whim, I thought, can I upload the same file with a different name? So I renamed myaudio.mp3 to myaudiox.mp3. That upload worked!

Okay good, now I just need to rename that to the actual name.

There is no Rename function in the web portal or in Azure Storage Explorer. Sigh.

Azure Storage Explorer does have a Clone option, so I used that to clone myaudiox.mp3 to myaudio.mp3. Then I deleted myaudiox.mp3.

This should not be this hard, but at least this week’s MP3 has been uploaded.

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.

This site uses Akismet to reduce spam. Learn how your comment data is processed.