Created
June 7, 2018 17:20
-
-
Save vykhand/c332fd30a26ace484dfd1bf84a844abc to your computer and use it in GitHub Desktop.
Send message to Azure Event Hub from Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from azure.servicebus import ServiceBusService | |
api_key = {"namespace":"", | |
"policy_name":"", | |
"hub_name":"", | |
"policy_secret":""} | |
sbs = ServiceBusService(api_key["namespace"], shared_access_key_name=api_key["policy_name"], shared_access_key_value=api_key["policy_secret"]) | |
for i in range(1000): | |
sbs.send_event(api_key["hub_name"], '{ "DeviceId":"Hello", "Temperature":"10.0" }') | |
print("sending message " + str(i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment