Azure存储队列 - create_queue - 获取'binascii.Error:不正确的填充' [英] Azure storage queues - create_queue - getting 'binascii.Error: Incorrect padding'
问题描述
我只是尝试在python3.4中使用python sdk创建一个队列,但是使用以下代码:
pre $
from azure.storage import QueueService
q = QueueService(user,password)
q.create_queue('testqueue' )
我得到:
追溯(最近的最后一次呼叫):
文件new.py,第4行在< module>
q.create_queue('testqueue')
文件/usr/local/lib/python3.4/dist-packages/azure/storage/queueservice.py,第151行,在create_queue
request,self.account_name,self.account_key)
文件/usr/local/lib/python3.4/dist-packages/azure/storage/__init__.py,第447行,在_update_storage_queue_header
返回_update_storage_blob_header(请求,account_name,account_key)
文件/usr/local/lib/python3.4/dist-packages/azure/storage/__init__.py,第440行,在_update_storage_blob_header
account_key中) ))
文件/usr/local/lib/python3.4/dist-packages/azure/storage/__init__.py,第516行,_sign_storage_blob_request
_sign_string(account_key,string_to_sign)
文件/usr/local/lib/python3.4/dist-packages/azure/__init__.py,第988行,_sign_string
key = _decode_base64_to_bytes(key)
文件/ usr / local /lib/python3.4/dist-packages/azure/__init__.py,第167行,_decode_base64_to_bytes
返回base64.b64decode(data)
Fil e/usr/lib/python3.4/base64.py,第90行,b64decode
返回binascii.a2b_base64(s)
binascii.Error:不正确的填充
事实是,我正在尝试用单个队列创建一个ubuntu虚拟机的linux自动分级场。当这个队列包含多于x个消息时,农场会扩展,而不是使用1个VM,它使用2或3。
我已经拥有我的虚拟机,我配置了可用性设置,负载平衡,但我停在队列上。
有人可以帮助,这将是非常好的
谢谢
答案
我终于找到了一个答案在哪里可以找到我的Azure帐户名称和帐户密钥?
感谢Jason Hogg - MSFT为我的真正问题提出了疑问,我以为这是另一回事。
我终于找到了一个答案在哪里可以找到我的Azure帐户名和帐户密钥?
感谢Jason Hogg - MSFT为了解决我的真正问题,我以为这是另一回事。
EDIT: Where can I find my "user" and "password" for my storage account in Azure ? (see below).
I simply try to create a queue with the python sdk in python3.4 but with this code:
from azure.storage import QueueService
q = QueueService("user", "password")
q.create_queue('testqueue')
I get:
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
The thing is that I'm trying to create a linux auto-scaling farm of ubuntu VMs with a single queue. when this queue contains more than x message, the farm scales up and instead of using 1 VM, it uses 2 or 3.
I already have my VMs , I configured the availability set, the load-balancing but I'm stopped on queues.
It somebody could help, it would be great!
Thanks
Answer
I've finally found an answer here Where can I find my Azure account name and account key?
Thanks to Jason Hogg - MSFT for poiting my real problem, I thought it was another thing.
I've finally found an answer here Where can I find my Azure account name and account key?
Thanks to Jason Hogg - MSFT for poiting my real problem, I thought it was another thing.
这篇关于Azure存储队列 - create_queue - 获取'binascii.Error:不正确的填充'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!