我遇到了授权令牌签名的问题。
from azure.servicebus import ServiceBusService
key_name = 'RootManageSharedAccessKey' # SharedAccessKeyName from Azure portal
key_value = '***' # SharedAccessKey from Azure portal
service_namespace = 'lenioService'
sbs = ServiceBusService(service_namespace,
shared_access_key_name=key_name,
shared_access_key_value=key_value)
## To receive Messages !
sbs.create_subscription('cdmessages', 'AllMessages')
msg = sbs.receive_subscription_message('cdmessages', 'AllMessages', peek_lock=False)
print(msg.body)
它给我这个错误:
Traceback (most recent call last):
File "C:\Users\RH-TH\Desktop\azureTest.py", line 14, in <module>
sbs.create_subscription('cdmessages', 'AllMessages')
File "C:\Python27\lib\azure\servicebus\servicebusservice.py", line 497, in create_subscription
_dont_fail_on_exist(ex)
File "C:\Python27\lib\azure\__init__.py", line 890, in _dont_fail_on_exist
raise error
WindowsAzureError: Unknown error (40103: Invalid authorization token signature)
我遵循了以下步骤:https://github.com/Azure/azure-sdk-for-python。如果有需要,非常感谢您提供的任何帮助。