0
votes

I'm trying to utilize the spring-azure-starter-storage plugin for Spring to manage BLOBS in Azure Storage.

I've followed the following guide on how to setup the storage account and the application, and it works all fine until i turn on "Secure transfer required" in Confuration for the storage account. (which is required for my project)

https://docs.microsoft.com/en-us/azure/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-storage

my application.properties looks like this:

spring.cloud.azure.credential-file-path=my.azureauth
spring.cloud.azure.resource-group=xxxx
spring.cloud.azure.region=xxxxxx
spring.cloud.azure.storage.account=xxxx

The error i'm getting on upload is:

[http-nio-8080-exec-4] ERROR com.microsoft.azure.spring.cloud.storage.BlobStorageResource - Failed to open output stream of cloud blob
com.microsoft.azure.storage.StorageException: The account being accessed does not support http
....

Whitch makes sence. But how do i configure the connection to utilize https?

EDIT: I have since successfully implemented this using another approach shown in this tutorial: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-java-legacy

1
Have you tried to add azure.storage.enable-https=true to your application.properties. For more details, please refer to github.com/microsoft/azure-spring-boot/tree/master/… - Jim Xu
Yes. I tried this, but it did not work. - CMarker
Is that you still get the same error? - Jim Xu
Yes. I still got the same error - CMarker

1 Answers

0
votes

Summarize the answer to close this issue:

You should follow this article to configure https connection, a snippet as below:

public static final String storageConnectionString =
"DefaultEndpointsProtocol=https;" +
"AccountName=<account-name>;" +
"AccountKey=<account-key>";