Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1557

Azure Blob Storage: Support for Local Endpoints (eg Azurite)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.3.0
    • jclouds-blobstore

    Description

      Azurite provides a local Azure-compatible endpoint for purposes of testing without requiring network traffic or incurring costs on Azure.

      Currently while it is possible to define a custom endpoint this is not respected.

      In both

      https://github.com/apache/jclouds/blob/ba1504b38e725c45db304767ac76b2be4b71fd0d/providers/azureblob/src/main/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSigner.java#L66

      https://github.com/apache/jclouds/blob/ca5190636a5fc1ffe48d0d6b8087ad160c0b7d80/providers/azureblob/src/main/java/org/jclouds/azure/storage/filters/SharedKeyLiteAuthentication.java#L95

       

      The `storageUrl` is hard-coded to the Azure location

      this.storageUrl = URI.create("https://" + creds.get().identity + ".blob.core.windows.net/");
      

       

      This should be made to respect a custom endpoint if configured, e.g.

       

      BlobStoreContext context = ContextBuilder.newBuilder("azureblob")
                       .credentials(storageAccountName, storageAccountKey)
                       .endpoint("http://localhost:10000")
                       .buildView(BlobStoreContext.class);
      
      

      In addition, similar to the AWS S3 connector (`enableVirtualHostBuckets`), a configurable property should be provided to change the format of the URLs used by Azure to include the storage account name in the path.

       

       

      Azure endpoint URL format (storage account in hostname)

      https://devstoreaccount1.blob.core.windows.net/

       

      Azurite endpoint URL format (storage account in path)

      http://localhost:10000/devstoreaccount1/

       

      Attachments

        Activity

          People

            gaul Andrew Gaul
            davidsloan Dave Sloan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h 40m
                2h 40m