[NO ISSUE][EXT]: Set log option for Azure SDK

Ext-ref: MB-62038
Change-Id: I00cf3c3d8ea839701bafae8863e49c6653c14c76
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19387
Reviewed-by: Hussain Towaileb <hussainht@gmail.com>
Reviewed-by: Michael Blow <mblow@apache.org>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
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 84d68e3..0a67534 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
@@ -50,6 +50,7 @@
 import org.apache.asterix.cloud.clients.profiler.RequestLimiterNoOpProfiler;
 import org.apache.asterix.common.exceptions.ErrorCode;
 import org.apache.asterix.common.exceptions.RuntimeDataException;
+import org.apache.asterix.external.util.azure.blob_storage.AzureConstants;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.io.FileReference;
 import org.apache.hyracks.control.nc.io.IOManager;
@@ -393,6 +394,7 @@
     private static BlobContainerClient buildClient(AzBlobStorageClientConfig config) {
         BlobContainerClientBuilder blobContainerClientBuilder =
                 new BlobContainerClientBuilder().containerName(config.getBucket()).endpoint(getEndpoint(config));
+        blobContainerClientBuilder.httpLogOptions(AzureConstants.HTTP_LOG_OPTIONS);
         configCredentialsToAzClient(blobContainerClientBuilder, config);
         BlobContainerClient blobContainerClient = blobContainerClientBuilder.buildClient();
         blobContainerClient.createIfNotExists();
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureConstants.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureConstants.java
index 9ade27b..01ee148 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureConstants.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureConstants.java
@@ -18,6 +18,9 @@
  */
 package org.apache.asterix.external.util.azure.blob_storage;
 
+import com.azure.core.http.policy.HttpLogDetailLevel;
+import com.azure.core.http.policy.HttpLogOptions;
+
 /*
  * Note: Azure Blob and Azure Datalake use identical authentication, so they are using the same properties.
  * If they end up diverging, then properties for AzureBlob and AzureDataLake need to be created.
@@ -27,6 +30,13 @@
         throw new AssertionError("do not instantiate");
     }
 
+    public static final HttpLogOptions HTTP_LOG_OPTIONS = new HttpLogOptions();
+    static {
+        HTTP_LOG_OPTIONS.setLogLevel(HttpLogDetailLevel.BASIC);
+        HTTP_LOG_OPTIONS.addAllowedQueryParamName("restype");
+        HTTP_LOG_OPTIONS.addAllowedQueryParamName("comp");
+        HTTP_LOG_OPTIONS.addAllowedQueryParamName("prefix");
+    }
     /*
      * Asterix Configuration Keys
      */
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java
index fb594b9..ac407f4 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/azure/blob_storage/AzureUtils.java
@@ -115,6 +115,8 @@
 
         // Client builder
         BlobServiceClientBuilder builder = new BlobServiceClientBuilder();
+        builder.httpLogOptions(AzureConstants.HTTP_LOG_OPTIONS);
+
         int timeout = appCtx.getExternalProperties().getAzureRequestTimeout();
         RequestRetryOptions requestRetryOptions = new RequestRetryOptions(null, null, timeout, null, null, null);
         builder.retryOptions(requestRetryOptions);