azure-eventhub-capture

Send events to Azure event hub using Python

旧巷老猫 提交于 2020-07-22 12:05:09
问题 Below is the sample code copied from Microsoft's site. I did replace the Event Hubs <namespace> , <eventhub> , <AccessKeyName> , and <primary key value> with the required values. import sys import logging import datetime import time import os from azure.eventhub import EventHubClient, Sender, EventData logger = logging.getLogger("azure") # Address can be in either of these formats: # "amqps://<URL-encoded-SAS-policy>:<URL-encoded-SAS-key>@<namespace>.servicebus.windows.net/eventhub" # "amqps: