Clemens Wolff created LIBCLOUD-1037:
---------------------------------------

             Summary: Azure Storage driver crashes when used with Azurite
                 Key: LIBCLOUD-1037
                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-1037
             Project: Libcloud
          Issue Type: Bug
            Reporter: Clemens Wolff


There's a popular emulator for Azure Storage called 
[Azurite|https://github.com/Azure/Azurite]. I tried to configure libcloud to 
talk to Azurite like so:

```
 from libcloud.storage.types import Provider
 from libcloud.storage.providers import get_driver

# the secret and account name are defined in the azurite documentation
 key = 'devstoreaccount1'
 secret = 
'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=='

# run azurite via `docker run -e executable=blob -d -t -p 10000:10000 -v 
arafato/azurite`
 host = 'localhost:10000'

AzureBlobs = get_driver(Provider.AZURE_BLOBS)
 driver = AzureBlobs(key, secret, host=host, secure=False)
 driver.create_container('somecontainer')
 ```

Running this script crashes: [Python 
stacktrace|https://user-images.githubusercontent.com/1086421/53447380-fa862c00-39e2-11e9-916a-97fd45be9de8.png],
 [Azurite 
stacktrace|https://user-images.githubusercontent.com/1086421/53447528-4933c600-39e3-11e9-9723-3648f9823ef4.png].

The root cause is that the AzureBlobsStorageDriver currently assumes that the 
storage accounts are always going to be identified via the hostname (e.g. 
someaccount.blob.core.windows.net) but Azurite expects the accounts to be 
identified via a path prefix (e.g. /someaccount).

 

Fixing this will require a change in the driver to add a prefix to all action 
URLs if a custom host is set. I believe it's valuable to make this change since 
it would enable the Azure Blobs driver in libcloud to be used more easily for 
automated integration testing where developers don't necessarily want to talk 
to a live Azure Storage account.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to