Azure-Samples / azure-sdk-for-java-storage-blob-upload-download

How to upload and download blobs from Azure Blob Storage with Java
16 stars 34 forks source link

Use https for requests to storage account #6

Closed dennyac closed 5 years ago

dennyac commented 6 years ago

When I attempted to run this project after setting the credentials in the environment variables, I ran into this error - Service error returned: 400

On further investigation, I determined that the underlying cause is -

Service error returned: com.microsoft.azure.storage.blob.models.StorageErrorException: Status code 400, "<?xml version="1.0" encoding="utf-8"?><Error><Code>AccountRequiresHttps</Code><Message>The account being accessed does not support http.

When we attempt to create a storage account, it seems like the default is "Enabled" for the "Secure transfer required" option. Changing to https to fix this

dennyac commented 6 years ago

The README of this project does mention to set Secure transfer required to DISABLED. However the steps to create a storage account has changed. So unless you go to the Advanced section, you won't have the option to disable secure transfer.

And it seems like others have run into this issue - https://github.com/Azure-Samples/storage-blobs-java-v10-quickstart/issues/5

seguler commented 5 years ago

Thank you @dennyac - we've just resolved this issue having not seen your PR. Regardless, much appreciated!