libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [libcloud] mkcello96 opened a new issue #1551: Azure blobs - empty string `key` workaround does not work
Date Thu, 28 Jan 2021 19:01:50 GMT

mkcello96 opened a new issue #1551:

   ## Summary
   I'm using libcloud to connect to Azure Gov, so I need to change `host` in my AzureBlobsStorageDriver
connection object (which uses `<account>` instead of the
default `<account>`). This does not work - the call fails with
`Unexpected status code: 400`.
   This broke after was merged ~2 years
   ## Detailed Information adds support for Azurite, which largely
assumes libcloud users would be setting `host` only if using an Azure emulator. Thus, it will
always set an `account_prefix`=`key` IFF a `host` is specified, which will break non-emulated
Azure calls ([see how a list containers call has a separate Request URI for Emulated calls](

   A workaround for those not using emulators was proposed [here](,
to set the key to '' (empty string). **This workaround also does not work** - the call also
fails with `Unexpected status code: 400`.
   After a lengthy debugging session I figured out why the proposed workaround does not work:
Setting `key` to the empty string does not prevent `account_prefix` from being set (it also
gets set to the empty string). Further, doing this adds an extra `/` to the Request URI ([code
which will cause the Azure request to fail. Setting `key=None` fixes this issue.
   However that is not the only issue with the proposed workaround - not having a `key` also
prevents Azure authentication from working. Therefore I had to add a `driver.connection.user_id
= key_variable` statement after the AzureBlobsStorageDriver object was initialized to fix
   TL;DR - my current workaround is to do this:
   AzureBlobsStorageDriver(key=None, secret=<secret>, host=<storageAccount>
   driver.connection.user_id = <storageAccount>
   My fix recommendation is that an `emulated` boolean flag parameter be added to the AzureBlobsStorageDriver
initializer, which will only set the `account_prefix` if it's True. This should also allow
the `key` parameter to be set with the `host`.
   OS: Mac OS
   Python version: 3.6.8
   Libcloud version: 3.3.1

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:

View raw message