I am trying to use the Azure Storage Java library with the Azure Government endpoints. My code is as follows.
CloudStorageAccount account = CloudStorageAccount.parse(connectionString);
connectionString
has the suffix of Azure Gov cloud. For some reason the values for the blob.storage URI are still marked as blob.core.windows.net
and I receive the following error. I am unable to run any blob operations.
com.microsoft.azure.storage.StorageException: The server encountered an unknown failure: at com.microsoft.azure.storage.StorageException.translateException(StorageException.java:178)
at com.microsoft.azure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:214)
at com.microsoft.azure.storage.blob.CloudBlobContainer.exists(CloudBlobContainer.java:749)
at com.microsoft.azure.storage.blob.CloudBlobContainer.exists(CloudBlobContainer.java:736)
at com.microsoft.azure.storage.blob.CloudBlobContainer.exists(CloudBlobContainer.java:710)
at com.scalegrid.cloudconnector.azure.AzureStorageClient.createContainerIfItDoesntExist(AzureStorageClient.java:369)
java.net.UnknownHostException: XXXX.core.usgovcloudapi.net
ERROR ~ s failed.
Code:12207
Is there any way I can get this to work ?
Update
I was using an earlier version of the Azure storage Java. Storage endpoints have not been added at this point. Updating to the newer version fixed it.