This is an automated email from the ASF dual-hosted git repository. mblow pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/asterixdb.git
The following commit(s) were added to refs/heads/master by this push: new b69cead3fb [NO ISSUE][*DB][STO] Support HTTP for Azure Blob Cloud Storage new b92e75492e Merge branch 'gerrit/phoenix' into 'master' b69cead3fb is described below commit b69cead3fb55399ab80584a9ef2bb3a93baed316 Author: Michael Blow <michael.b...@couchbase.com> AuthorDate: Wed Aug 20 16:18:17 2025 -0400 [NO ISSUE][*DB][STO] Support HTTP for Azure Blob Cloud Storage Support HTTP connections using shared key credentials (e.g. setting ${AZURE_STORAGE_ACCOUNT} and ${AZURE_STORAGE_KEY} in env). Ext-ref: MB-68179 Change-Id: I88583c6f7e69c294a95d8b0b30d7dab2ceef1ab9 Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20250 Reviewed-by: Michael Blow <mb...@apache.org> Tested-by: Michael Blow <mb...@apache.org> --- .../java/org/apache/asterix/test/common/TestConstants.java | 2 -- .../clients/azure/blobstorage/AzBlobStorageCloudClient.java | 13 +++++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestConstants.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestConstants.java index 8a6b99c446..8c59c56950 100644 --- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestConstants.java +++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/common/TestConstants.java @@ -45,10 +45,8 @@ public class TestConstants { public static final String ACCOUNT_NAME_PLACEHOLDER = "%azure-accountname%"; public static final String AZURITE_ACCOUNT_NAME_DEFAULT = "devstoreaccount1"; public static final int AZURITE_PORT = 15055; - public static final String AZURITE_HOSTNAME = "127.0.0.1:" + AZURITE_PORT; public static final String AZURITE_ENDPOINT = "http://127.0.0.1:" + AZURITE_PORT + "/" + AZURITE_ACCOUNT_NAME_DEFAULT; - // account key public static final String ACCOUNT_KEY_PLACEHOLDER = "%azure-accountkey%"; public static final String AZURITE_ACCOUNT_KEY_DEFAULT = diff --git a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/azure/blobstorage/AzBlobStorageCloudClient.java b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/azure/blobstorage/AzBlobStorageCloudClient.java index e2bbb5b0f2..d7b680eb9e 100644 --- a/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/azure/blobstorage/AzBlobStorageCloudClient.java +++ b/asterixdb/asterix-cloud/src/main/java/org/apache/asterix/cloud/clients/azure/blobstorage/AzBlobStorageCloudClient.java @@ -407,16 +407,21 @@ public class AzBlobStorageCloudClient implements ICloudClient { private static void configCredentialsToAzClient(BlobServiceClientBuilder builder, AzBlobStorageClientConfig config) { - if (config.isAnonymousAuth()) { - StorageSharedKeyCredential creds = - new StorageSharedKeyCredential(AZURITE_ACCOUNT_NAME, AZURITE_ACCOUNT_KEY); - builder.credential(creds); + String storageAccount = System.getenv("AZURE_STORAGE_ACCOUNT"); + String storageKey = System.getenv("AZURE_STORAGE_KEY"); + + if (storageAccount != null && storageKey != null) { + builder.credential(new StorageSharedKeyCredential(storageAccount, storageKey)); + } else if (config.isAnonymousAuth()) { + // TODO(mblow): this mapping anonymous auth -> Azurite default account (hack) should be removed ASAP + builder.credential(new StorageSharedKeyCredential(AZURITE_ACCOUNT_NAME, AZURITE_ACCOUNT_KEY)); } else { builder.credential(config.createCredentialsProvider()); } } private static String getEndpoint(AzBlobStorageClientConfig config) { + // TODO(mblow): this mapping anonymous auth -> Azurite default endpoint (hack) should be removed ASAP return config.isAnonymousAuth() ? AZURITE_ENDPOINT + config.getBucket() : config.getEndpoint() + "/" + config.getBucket(); }