Azure storage queues - create_queue - getting 'binascii.Error: Incorrect padding'

Azure storage queues - create_queue - getting 'binascii.Error: Incorrect padding'

编辑:在 Azure 中的哪里可以找到我的存储帐户的 "user" 和 "password"? (见下文)。

我只是尝试在 python3.4 中使用 python sdk 创建一个队列,但使用以下代码:

from azure.storage import QueueService

q = QueueService("user", "password")
q.create_queue('testqueue')

我得到:

Traceback (most recent call last):
  File "new.py", line 4, in <module>
    q.create_queue('testqueue')
  File "/usr/local/lib/python3.4/dist-packages/azure/storage/queueservice.py", line 151, in create_queue
request, self.account_name, self.account_key)
  File "/usr/local/lib/python3.4/dist-packages/azure/storage/__init__.py", line 447, in _update_storage_queue_header
return _update_storage_blob_header(request, account_name, account_key)
  File "/usr/local/lib/python3.4/dist-packages/azure/storage/__init__.py", line 440, in _update_storage_blob_header
account_key)))
  File "/usr/local/lib/python3.4/dist-packages/azure/storage/__init__.py", line 516, in _sign_storage_blob_request
_sign_string(account_key, string_to_sign)
  File "/usr/local/lib/python3.4/dist-packages/azure/__init__.py", line 988, in _sign_string
key = _decode_base64_to_bytes(key)
  File "/usr/local/lib/python3.4/dist-packages/azure/__init__.py", line 167, in _decode_base64_to_bytes
return base64.b64decode(data)
  File "/usr/lib/python3.4/base64.py", line 90, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding

问题是我正在尝试创建一个 linux 具有单个队列的 ubuntu VM 的自动缩放场。当此队列包含多于 x 条消息时,服务器场会扩大规模,而不是使用 1 个 VM,而是使用 2 或 3 个。

我已经拥有我的 VM,我配置了可用性集和负载平衡,但我在队列中停止了。

如果有人能帮忙,那就太好了!

谢谢

回答

我终于在这里找到了答案我在哪里可以找到我的 Azure 帐户名和帐户密钥?

感谢 Jason Hogg - MSFT 提出了我真正的问题,我认为这是另一回事。

您是否尝试过将 "user" 替换为您的存储帐户名称并将 "password" 替换为与您的存储帐户关联的访问密钥?

贾森

我终于在这里找到了答案Where can I find my Azure account name and account key?

感谢 Jason Hogg - MSFT 提出了我真正的问题,我认为这是另一回事。