Streaming Logs from Azure Event Hubs
This guide is for customers who want to stream logs from Azure Event Hubs into SenseOn. You do these steps in your own Azure tenant. Then you give a small set of details to SenseOn. The guide covers three cases:
- You do not have an Event Hub yet.
- You already have one or more Event Hubs.
- A single hub carries data from several sources.
Share the connection string with SenseOn only over an approved secure channel. Do not send it by email, chat or ticket. The connection string is a credential.
How it works
SenseOn reads your Event Hub through its Kafka-compatible endpoint. Each Event Hubs namespace of the Standard tier or higher has this endpoint on port 9093. This method works with a new Event Hub and with an Event Hub that you already have.
You do these tasks:
- Provision the Event Hub, or find the Event Hub that you already have.
- Give SenseOn a read-only access policy and a dedicated consumer group.
- Configure your log sources to send to the Event Hub.
- Give the connection details to SenseOn.
SenseOn does all the other tasks.
Your log producers (Entra ID logs, Azure Monitor, apps)
-> Azure Event Hub (your tenant)
-> Kafka protocol (TLS, 9093)
-> SenseOn ingestion
Prerequisites
- An Azure subscription where you have the Contributor role or higher. As an alternative, access to your existing Event Hubs namespace, with permission to add consumer groups and access policies.
- To stream Microsoft Entra ID logs, the Security Administrator or Global Administrator role. The Contributor role on a subscription is not sufficient for Entra ID diagnostic settings.
- For new namespaces, register the
Microsoft.EventHubresource provider:
az provider register -n Microsoft.EventHub
The CLI examples in this guide use Bash. In Azure Cloud Shell, change to Bash before you run them. PowerShell uses different rules for variable assignment and quotes.
Before you start
Examine these items first. Each item can stop the setup before it completes.
-
Azure Policy. In the portal, go to Policy > Assignments. Look for assignments on the subscription and its management groups that deny public network access on Event Hubs namespaces. Also look for assignments that disable local (SAS key) authentication. If local authentication is disabled, Azure rejects the Listen connection string in Step 2. If public access is denied, refer to Step 4.
-
Diagnostic settings limit. Each resource, each subscription and the Entra ID tenant allow a maximum of 5 diagnostic settings. It is possible that you already stream to other tools, for example a SIEM or a service that monitors resources. In this case, find how many diagnostic settings each resource uses before you add one for SenseOn.
az monitor diagnostic-settings list --resource <resource-id> --query "length(@)" az monitor diagnostic-settings subscription list --query "length(value)" -
Regions. Write down the regions of the resources that you want to monitor. Refer to One namespace per region.
Step 0: Tier requirement (read first)
The Event Hubs namespace must be Standard tier or higher. The Basic tier does not have the Kafka endpoint. It also allows only the single $Default consumer group. Thus you cannot use the Basic tier.
If your existing namespace is Basic, upgrade it to Standard. This is an in-place change. Your data and hubs stay. Standard is sufficient for log ingestion.
To see the tier, look at the Tier column in the Event Hubs list.

Step 1: Choose your path
Path A: you do not have an Event Hub yet
The hierarchy is: Namespace (the broker) -> Event Hub (the stream) -> a Consumer group and a Listen-only Shared Access Policy.
Portal
- Go to Create a resource > Event Hubs. Create a namespace. Select a region near your log sources. Set Pricing tier = Standard.
- In the namespace, select + Event Hub. Give it a name (for example
senseon-ingress). A sensible default is 4 partitions. Create one hub for each log stream that you want to keep separate. As an alternative, if you accept mixed streams, create a single hub (refer to Step 3). - In the Event Hub, go to Consumer groups > + Consumer group. Name the group
senseon. - In the Event Hub, go to Shared access policies > + Add. Name the policy
senseon-listen. Tick only Listen. Then select Create.


Azure CLI
RG=rg-senseon-ingest
NS=<your-namespace> # globally unique, becomes <NS>.servicebus.windows.net
HUB=senseon-ingress
LOCATION=westeurope
az group create -n "$RG" -l "$LOCATION"
az eventhubs namespace create -g "$RG" -n "$NS" -l "$LOCATION" --sku Standard
az eventhubs eventhub create -g "$RG" --namespace-name "$NS" -n "$HUB" --partition-count 4
az eventhubs eventhub consumer-group create -g "$RG" --namespace-name "$NS" --eventhub-name "$HUB" -n senseon
az eventhubs eventhub authorization-rule create -g "$RG" --namespace-name "$NS" --eventhub-name "$HUB" -n senseon-listen --rights Listen
Throughput units and auto-inflate. The size of a Standard namespace is in throughput units. One throughput unit lets in 1 MB/s or 1,000 events/s, and lets out 2 MB/s. If the traffic is more than this limit, Azure throttles the senders. Auto-inflate automatically adds throughput units up to a maximum that you set. But it never removes them again, so set a sensible maximum.
For Activity log, Entra ID and a small number of resources, start with 1 throughput unit and auto-inflate up to 4. For a busy region, start at 2 with a maximum of 10. An example of a busy region is one that carries Entra ID sign-ins for a large tenant.
az eventhubs namespace update -g "$RG" -n "$NS" --capacity 1 --enable-auto-inflate true --maximum-throughput-units 4
One namespace per region
The diagnostic setting of a resource can stream only to an Event Hub in the same region as the resource. Your Key Vaults, AKS clusters or other resources can be in different regions. In this case, create one namespace in each of those regions. Give each namespace the same hub, consumer group and policy. Send SenseOn one connection string for each namespace.
Subscription Activity logs and Entra ID logs do not belong to a region. Send them to any one of your namespaces.
Path B: you already have an Event Hub or hubs
It is not necessary to create anything again. For each hub that you want SenseOn to read, do these steps:
- Make sure that the namespace tier is Standard or higher (Step 0).
- Add a dedicated consumer group named
senseonon each hub. - Create a Listen-only access policy. If there are several hubs, a namespace-level policy is the simplest, because one connection string then covers all of them. If you want a narrower scope, create a per-hub Listen policy as an alternative. Then send one connection string for each hub.
- Write down the names of the hubs that SenseOn must read.
Do not give SenseOn the
$Defaultconsumer group or one your own consumers already use. Consumer groups share read offsets. If SenseOn and your existing readers use the same group, they compete for messages. They also corrupt the position of each other. A separate group does not disrupt your existing readers. It gives SenseOn an independent cursor over the same data. Standard allows up to 20 consumer groups for each hub.
Azure CLI (existing namespace)
RG=<your-resource-group>
NS=<your-existing-namespace>
# Add a dedicated consumer group on each hub SenseOn should read (repeat per hub)
az eventhubs eventhub consumer-group create -g "$RG" --namespace-name "$NS" --eventhub-name <existing-hub> -n senseon
# Create one namespace-level Listen policy that covers all hubs
az eventhubs namespace authorization-rule create -g "$RG" --namespace-name "$NS" -n senseon-listen --rights Listen
Step 2: Retrieve the connection string
SenseOn must have this secret. Keep it safe.
Namespace-level policy (covers all hubs, recommended for several hubs)
az eventhubs namespace authorization-rule keys list -g "$RG" --namespace-name "$NS" -n senseon-listen --query primaryConnectionString -o tsv
It looks like Endpoint=sb://<NS>.servicebus.windows.net/;SharedAccessKeyName=senseon-listen;SharedAccessKey=... (no EntityPath).
Per-hub policy (one connection string per hub)
az eventhubs eventhub authorization-rule keys list -g "$RG" --namespace-name "$NS" --eventhub-name "$HUB" -n senseon-listen --query primaryConnectionString -o tsv
It looks like Endpoint=sb://<NS>.servicebus.windows.net/;SharedAccessKeyName=senseon-listen;SharedAccessKey=...;EntityPath=<HUB>.
Portal equivalent: Go to Shared access policies > senseon-listen. Copy Connection string–primary key. Do this on the namespace or on the hub, for the policy that you created.

Step 3: Point your log sources at the Event Hub
If you already stream into an existing hub, your sources have the correct setup. Tell SenseOn which hubs to read. If you do not, these are the usual options:
- Microsoft Entra ID: In the Microsoft Entra admin center, go to Monitoring & health > Diagnostic settings > + Add diagnostic setting. Tick the categories that follow. Then select Stream to an event hub. You must have the Security Administrator or Global Administrator role.
SignInLogs,NonInteractiveUserSignInLogs,ServicePrincipalSignInLogs,ManagedIdentitySignInLogsandAuditLogs.- The three non-interactive sign-in categories cover token refreshes, service principal sign-ins and managed identity sign-ins. The SenseOn Microsoft Entra ID integration collects only interactive sign-ins. Thus include these three categories to cover the other sign-ins.
- Activity log: In the Azure portal, go to Monitor > Activity log > Export Activity Logs > + Add diagnostic setting. This setting applies to one subscription. Thus do it again for each subscription that you want to cover.
- Resource diagnostics: For each resource, go to Diagnostic settings > + Add diagnostic setting > Stream to an event hub in the same region. Useful categories include Key Vault
AuditEventand AKSkube-audit-adminandguard. - Your own applications: Send through the Event Hubs SDK, or through any Kafka producer that sends to
<NS>.servicebus.windows.net:9093.
A single hub carrying several sources
A hub can carry data from many sources at the same time. For example, several Diagnostic settings can all stream to the same hub. Azure diagnostic logs describe themselves with fields such as category and resourceId. Thus SenseOn can see the difference between records from their content, and it does not depend on one hub for each source. Before you enable log categories, ask your SenseOn contact which categories SenseOn parses.
SenseOn has two requests that make this easier:
- If it is easy for you, send different log types to separate hubs. This makes the routes cleaner. This request is optional.
- For each hub that mixes sources, tell SenseOn that the hub is mixed. Also tell SenseOn if the data is standard Azure diagnostic-settings JSON. A hub can also carry a custom or non-Azure format that has no common field to show its source. If so, tell SenseOn. SenseOn can then plan for it, or ask you to separate that stream.
Step 4: Networking
SenseOn reads the namespace through its public Kafka endpoint on TCP 9093. If you did not restrict access to the namespace, no more steps are necessary.
If you restrict access with namespace firewall rules but public network access stays enabled, ask your SenseOn contact for the egress IP ranges. Add these ranges to the allowlist.
If you disable public network access and expose the namespace through a Private Endpoint only, SenseOn cannot get to the public Kafka endpoint. An IP allowlist does not help in this case. Before you restrict access to the namespace, talk to your SenseOn contact. Then you and SenseOn can agree a connectivity path that works.
Step 5: Hand over to SenseOn
Send SenseOn the items that follow. Send the connection string over a secure channel only:
| Item | Example | Where to find it |
|---|---|---|
| Namespace bootstrap host | <NS>.servicebus.windows.net:9093 |
Namespace overview, add :9093 to the end. One for each namespace if you have several regions |
| Event Hub name(s) | senseon-ingress, entra-logs, activity-logs |
The hub instance names. List all hubs that SenseOn must read |
| Consumer group | senseon |
The dedicated group that you created on each hub |
| Connection string | Endpoint=sb://...;SharedAccessKey=... |
Step 2 (Listen policy) |
Also tell SenseOn this information for each hub:
- Single-source or mixed? If the hub is mixed, also tell SenseOn if the data is Azure diagnostic-settings JSON.
Good practice
- Least privilege: The policy that you share is Listen only. Never give SenseOn the namespace-level
RootManageSharedAccessKey. - Dedicated consumer group: Always give SenseOn its own
senseongroup. Never give$Defaultor a group that your own consumers use. - Rotation: To rotate the key, regenerate the SAS key in Azure. Then send SenseOn the new connection string. SenseOn updates its configuration without downtime.
- Retention: The Event Hub retention (1 to 7 days on Standard) is a buffer. It is not long-term storage.