Stream Data to Azure Event Hub
We provide an Azure Event Hub endpoint for secure, unidirectional data ingestion. Your systems initiate outbound connections using AMQP over TLS or HTTPS and push events using send-only credentials. We cannot access your network or initiate inbound connections.
1. Sending Data
Fetch records from your data source, format them to the required schema, and send them to our Event Hub using your provided credentials.
Follow Microsoft's official guide: Send events using Python (Similar guides exist for .NET, Java, Node.js etc)
Required Fields
Regardless of the delivery method, each data record should contain the following three fields as a minimum:
- sensor_id / tag_id – a unique identifier for each tag or sensor from your upstream system.
- timestamp – the date and time the sensor reading was taken, in a consistent format of your choice in UTC timezone.
- value – the numeric measurement recorded at that timestamp. It could also be an alphanumeric or string value if needed (e.g. we sometimes get “Running” and “Stopped” as string values).
Example Payload
{
"sensor_id": "compressor-7:vibe_x",
"timestamp": "2025-08-19T08:30:00Z",
"value": 42.1
}
2. Authentication
SAS Connection String (Recommended)
This is the simplest and fastest way to connect. We provide you with a SAS connection string of the form:
Endpoint=sb://{namespace}.servicebus.windows.net/;
SharedAccessKeyName=send-only;
SharedAccessKey=...;
EntityPath={event_hub_name}
- Works with all official Azure SDKs and REST
- Minimal setup required
- Recommended for almost all integrations
Python Example (SAS):
from azure.eventhub import EventHubProducerClient, EventData
connection_str = "Endpoint=sb://{namespace}.servicebus.windows.net/;SharedAccessKeyName=send-only;SharedAccessKey=...;EntityPath={event_hub_name}"
eventhub_name = "{event_hub_name}"
producer = EventHubProducerClient.from_connection_string(
conn_str=connection_str,
eventhub_name=eventhub_name
)
with producer:
batch = producer.create_batch()
batch.add(EventData('{"sensor_id":"s1","timestamp":"2025-08-19T08:30:00Z","value":42.1}'))
producer.send_batch(batch)
Entra ID
For clients that require Azure Active Directory token-based authentication, we can provide an Entra ID (service principal) with the Azure Event Hubs Data Sender role.
We will share:
- TENANT_ID (our Azure AD tenant)
- CLIENT_ID (App Registration ID)
- CLIENT_SECRET (secret/password for the service principal)
Python Example (Entra ID):
from azure.identity import ClientSecretCredential
from azure.eventhub import EventHubProducerClient, EventData
tenant_id = "<TENANT_ID>"
client_id = "<CLIENT_ID>"
client_secret = "<CLIENT_SECRET>"
credential = ClientSecretCredential(tenant_id, client_id, client_secret)
producer = EventHubProducerClient(
fully_qualified_namespace="{namespace}.servicebus.windows.net",
eventhub_name="{event_hub_name}",
credential=credential
)
with producer:
batch = producer.create_batch()
batch.add(EventData('{"sensor_id":"s1","timestamp":"2025-08-19T08:30:00Z","value":42.1}'))
producer.send_batch(batch)
3. FAQ
- Which option should I use? Use the SAS connection string unless your security policies require Entra ID.
- How large can a message be? Default up to 1 MB per event.
- Is this push or pull? You push data into our Event Hub. We consume it. One-way only.
- Detailed FAQ documentation Azure Event Hubs FAQ