Created
April 20, 2017 18:13
-
-
Save gregjhogan/ef37c38371193c8e9d08d867c05ad210 to your computer and use it in GitHub Desktop.
Push a file to a blob in an Azure storage account
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X PUT -T ./{file.dat} -H "x-ms-date: $(date -u)" -H "x-ms-blob-type: BlockBlob" "https://{storageaccount}.blob.core.windows.net/backups/{file.dat}?{sas-token}" |
Hi, I just tested uploading 121Mb file and no issues happened. Could you advise on your settings?
works perfect, thanks!
Tried with a 324MB file: The request body is too large and exceeds the maximum permissible limit.
A workaround was to use the Azure Microsoft-provided utility blobxfer
: https://github.com/Azure/blobxfer
Sometimes, date -u
will output invalid format on different timezone or country, an alternative way is
-H "x-ms-date: $(TZ=GMT date '+%a, %d %h %Y %H:%M:%S %Z')"
Had to use the following to get a x-ms-date header matching https://learn.microsoft.com/en-us/rest/api/storageservices/representation-of-date-time-values-in-headers
-H "x-ms-date: $(TZ=GMT LC_TIME=C date '+%a, %d %h %Y %H:%M:%S %Z')"
Not works: 'The value for one of the HTTP headers is not in the correct format'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just FYI for future google-users who find this, unfortunately it will only work for files <= 4MB (see https://support.microsoft.com/en-gb/help/4016806/the-request-body-is-too-large-error-when-writing-data-to-azure-file )