Azure storage queues - create_queue - getting '

2019-09-16 18:48发布

问题:

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.

回答1:

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.



回答2:

Have you tried substituting "user" for your storage account name and "password" for the access key associated with your storage account?

Jason