Using DAS proxy to access ADLS and ABS compatible buckets

External applications and query engines can access the Azure Data Lake Storage (ADLS) and Azure Blob Storage (ABS) compatible buckets that are managed by watsonx.data through DAS proxy.

watsonx.data on Red Hat® OpenShift®

Attention: DAS proxy support for ADLS and ABS works only with AccountKey to pass watsonx.data credential. Using SASToken to pass watsonx.data credential is not supported.
To access the ADLS and ABS compatible buckets:
  1. Get the DAS endpoint from the watsonx.data information window. Click the i icon on the home page to open the information window.
  2. Replace the ADLS or ABS endpoint with the DAS endpoint in your Java code. Replace the access name with the encoded value as follows:
    <ADLS or ABS account name>|base64{<instanceid>|ZenApikey base64{username:<apikey>}}
    Note: To get the Base64 encoded string, use one of the following commands:
    • printf "username:<apikey>" | base64
    • echo -n "username:<apikey>" | base64
  3. Replace the container name in the Java code as follows:
    cas/v1/proxy/<bucketname in watsonx.data>
Java code example to use DAS:
      //For SaaS <ADLS or ABS account name>|base64{<crn>|Basic base64{ibmlhapikey_<user_id>:<IAM_APIKEY>}}
      //For watsonx.data on AWS <ADLS or ABS account name>|base64{<crn>|Basic base64{ibmlhapikey_ServiceId-<service_id>:<APIKEY>}}
      String accountName = "<ADLS or ABS account name>|base64{<instanceid>|ZenApikey base64{username:<apikey>}}";
      String accountKey = "any string";
      String endPoint = "<DAS endpoint>";
      String containerName ="cas/v1/proxy/<bucketname in watsonx.data>";
      String endpoint = String.format(endPoint,accountName);

      BlobServiceClient blobServiceClient = new BlobServiceClientBuilder()
                .endpoint(endpoint)
                .credential(new StorageSharedKeyCredential(accountName, accountKey))
                .buildClient();

      BlobContainerClient containerClient = blobServiceClient.getBlobContainerClient(containerName);