Skip to content

Instantly share code, notes, and snippets.

@mossey
Created April 11, 2018 09:47
Show Gist options
  • Save mossey/c9c37ccd8c9a00ff2a6c7042a6ff979a to your computer and use it in GitHub Desktop.
Save mossey/c9c37ccd8c9a00ff2a6c7042a6ff979a to your computer and use it in GitHub Desktop.
Publish to ASB
from azure.servicebus import ServiceBusService
from azure.servicebus import Message
key_name = "component" # SharedAccessKeyName from Azure portal
key_value = "GQ0I5xfvkOKU4u719LeXEQV7U/iiSJBmcD7HwA05rt4=" # SharedAccessKey from Azure portal
sbs = ServiceBusService("dev-bonga-asb",
shared_access_key_name=key_name,
shared_access_key_value=key_value)
msg = Message(
' {"trackingID":"mljdlkasjldkjasldkjlaksd", "senderJID":"moses@localhost","conversationID":"jsalkjdlkjakldjaklsdjlkasjd","transactionUUID":"***[email protected]\\/0303\\/2727 04:55:03","transactionType":"AccountBalance","responseCode":"00","responseDescription":"697.00"}')
sbs.send_queue_message('example_queue', msg)
azure-servicebus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment