Azure Event Hub

Oracle AI Database@Azure environments can generate operational telemetry that you can monitor, retain, analyze, or forward to downstream systems. Depending on the your monitoring architecture, Azure Monitor diagnostic settings can route this data to Azure-native observability services such as Azure Monitor, Azure Log Analytics, Azure Storage, Azure Event Hubs, or supported partner solutions.

Azure Event Hubs Use Cases

Use Azure Event Hubs when you want to stream monitoring, event, audit, or telemetry data to an Azure-native ingestion point for further processing.

The following table shows common use cases.

Use case Destination
Query logs and metrics inside Azure Azure Log Analytics Workspace
Use KQL queries, workbooks, and Azure-native alerting Azure Log Analytics Workspace
Archive logs for retention or compliance Azure Storage Account
Stream events to external consumers Azure Event Hubs
Integrate with SIEM or observability platforms Azure Event Hubs or Azure Monitor partner solutions
Build a custom forwarding pipeline Azure Event Hubs with Azure Functions, Stream Analytics, or a custom consumer

Azure Monitor diagnostic settings can route platform metrics, activity logs, and resource logs to multiple destinations, including Azure Log Analytics Workspace, Azure Storage Account, Azure Event Hubs, and Azure Monitor partner solutions.

Complete the following steps:

  1. Create an Azure Event Hubs Namespace
    1. From Azure portal, search for Event Hubs.This screenshot shows how to create a namespace.
    2. Select the Create button to create a namespace.This screenshot shows how to create a namespace.
    3. On the Basics tab of the Create Namespace page, enter the following information:
      1. Choose your Subscription and Resource group.
      2. Enter a descriptive Namespace name. The namespace must be between 6 and 50 characters long. The namespace can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number.
      3. Select the Azure region from the Region dropdown list.
      4. From the Pricing tier list, select the pricing tier based on the expected Throughput Units and retention requirements.
      5. Select the Next: Advanced > button.
    4. On the Advanced tab of the Create Namespace page, enter the following information:
      1. Select the minimum TLS version from the dropdown list.
        Note

        Increasing the minimum TLS version prevents clients using a lower TLS version from connecting to the namespace.
      2. Enable or disable the Local Authentication toggle if you want to enable or disable local authentication (SAS key authentication).
      3. Select the Next: Networking > button.
    5. On the Networking tab of the Create Namespace page, enter the following information:
      1. From the Connectivity method section, choose the connectivity method. You can connect to this namespace either publicly, via public IP addresses or service endpoints, or privately, using a private endpoint.
        Note

        Private access is only available on Dedicated, Premium or Standard namespaces.
      2. Select the Next: Tags > button.
    6. On the Tags tab of the Create Namespace page, you can add a tag. This step is optional. Select the Next: Review + create > button.
    7. Review the information. Once validation succeeds, select the Create button.
    tttt
  2. Create an Event Hub
    1. After the namespace is created, open the Event Hubs namespace that you created in the step 1g.
    2. From the left menu, expand the Entities section and then select Event Hubs.
    3. To create a new Event Hub, select the + Event Hub button.
    4. On the Basics tab of the Create Event Hub page, enter the following information:
      1. Enter a descriptive Name for your Event Hub. The name can contain only letters, numbers, periods, hyphens and underscores. The name must start and end with a letter or number.
      2. Use the Partition count slider to set a value for partitions count.
      3. From the Retention section, configure the retention setting for your Event Hub.
        1. Select the Cleanup policy. Events are retained or discarded based on the cleanup policy.
        2. Enter the Retention time (hrs). This value specifies the maximum time that an event is retained before it is discarded.
      4. Select the Next: Capture > button.
    5. On the Capture tab of the Create Event Hub page, enter the following information:
      1. You can choose to use the Capture feature.
        Note

        The Capture feature is not available in a Basic Tier Namespace.
      2. Select the Next: Review + create > button.
    6. Review the information. Once validation succeeds, select the Create button.
    ttt
    Example:
    • Namespace: exadbeventhub01
    • Event Hub: insights-metrics-pt1m
  3. Create Consumer Groups

    A consumer group provides an independent view of the Event Hub stream. Each consuming application or service should use its own consumer group so that it reads events independently without affecting other consumers. To create a consumer group:

    1. From Azure portal, select Event Hubs.
    2. From the list, select your Events Hub Namespace that you are using.
    3. Expand the Entities section, and then select Event Hubs.
    4. Select the Name of your Event Hubs that you are using.
    5. Select the + Consumer group button to create a consumer group.
      1. Enter a unique Name for your consumer group.
      2. Select the Create button.
    6. Verify that the consumer group is displayed in the list.
    Example names:
    • data-explorer-demo
    • stream-analytics-demo
    Recommended names:
    • data-explorer-demo
    • stream-analytics-demo
    • powerbi-demo
    • fabric-demo
    • siem-consumer
    • custom-api-consumer

    Avoid using a single generic consumer group for multiple applications. Using separate consumer groups simplifies troubleshooting and operations.

    This screenshot shows how to create an Event Hub.
  4. Configure Diagnostic Routing
    1. From Azure portal, select Oracle AI Database@Azure, and then select a resource that emits logs or metrics.
    2. From the left menu, expand the Monitoring section, and then select Diagnostic settings.
    3. Select the + Add diagnostic setting button.
      1. From the Diagnostic setting page, select the required Logs or Metrics.
      2. From the Destination details section, choose the destination. Available destinations include:
        • Log Analytics Workspace
        • Storage Account
        • Event Hub
        • Partner Solution

        Choose the Stream to an event hub option to send data to Event Hubs. Select Event Hubs namespace , Event Hub name, and Event hub policy name.

      3. Select the Save button.

      Azure Monitor diagnostic settings can send logs and metrics to Event Hubs for streaming to external systems, including SIEM and other log analytics solutions.

  5. Validate Events with Event Hub Data Explorer

    Event Hub Data Explorer provides a simple way to verify that events arrive in Event Hubs.

    1. From Azure portal, select Event Hubs and then select your Event Hubs Namespace that you are using.
    2. From the left menu, select Data Explorer.
      1. From the dropdown list, select Event Hub and Consumer group.
      2. Choose your Event position.
      3. Select the View events button.
    This screenshot shows how to validate events.
  6. Process Event Hubs Data with Azure Stream Analytics

    Azure Stream Analytics can consume events from Event Hubs, transform the data, and write output to Azure Storage, Power BI, Azure SQL, or another Event Hub.

    1. Complete the following steps to create a Azure Stream Analytics job.
      1. From Azure portal, search for Stream Analytics jobs.
      2. Select the Create button.
      3. On the Basics tab of the New Stream Analytics job page, enter the following information:
        1. Select Subscription and Resource group.
        2. Enter a descriptive Name. Stream Analytics job name can contain alphanumeric characters, hyphens, and underscores only and must be 3-63 characters long.
        3. From the dropdown list, select the Region.
        4. Choose the Hosting environment as Cloud.
        5. Select the number of Streaming units.
        6. Select the Next button.
      4. On the Storage tab of the New Stream Analytics job page, you can add a storage account. This step is optional. Select the Next button.
      5. On the Tags tab of the New Stream Analytics job page, you can add a tag. This step is optional. Select the Next button.
      6. On the Managed Identity tab of the New Stream Analytics job page, you can enable managed identity. This step is optional. Select the Next button.
      7. On the Review + create tab of the New Stream Analytics job page, review your information and once the validation succeeds, select the Create button.
      This screenshot shows how to create Stream Analytics job.
    2. Complete the following steps to add Event Hub as input.
      1. Navigate to Job topology.This screenshot shows how to navigate to job topology.
      2. Select Inputs.
      3. Select the + Add stream input button and then choose the Event Hub option.
      4. On the Event Hub input configuration page, enter the following information:
        1. Enter an alias in the Input alias field.
        2. Choose the Select Event Hub from your subscriptions option and then select your Subscription.
        3. Select the Event Hub namespace that you created previously.
        4. Choose the Use existing option for Event Hub name.
        5. Enter your Event Hub consumer group.
        6. Set the event serialization format to JSON if the event body uses JSON.
        7. Select the Save button to save your settings.
        Example input alias:
        • ehinput
      This screenshot shows how to create an input.
    3. Complete the following steps to add Azure Blob Storage as output.
      1. Navigate to Job topology.
      2. Select Outputs.
      3. Select the + Add button and then choose Blob Storage / ADLS Gen2.
      4. On the Blob storage output settings page, enter the following information.
        1. Enter an alias for the output.
        2. Select your Azure subscription.
        3. Select your Azure Storage account.
        4. Enter a name for the container
        5. Select JSON or CSV serialization.
        6. Select the Save button to save your settings.
        Example output alias:
        • bloboutput
      This screenshot shows how to create an output.
    4. Complete the following steps to add the query.
      1. Use the Stream Analytics query editor to transform incoming events.
        
        SELECT
            r.ArrayValue.metricName,
            AVG(r.ArrayValue.average) AS AvgValue,
            MAX(r.ArrayValue.maximum) AS MaxValue,
            MIN(r.ArrayValue.minimum) AS MinValue,
            COUNT(*) AS Samples,
            System.Timestamp() AS WindowEndTime
        INTO
            bloboutput
        FROM
            ehinput
        CROSS APPLY GetArrayElements(ehinput.records) AS r
        WHERE
            r.ArrayValue.metricName IN (
                'oci_autonomous_database/CpuUtilization',
                'oci_autonomous_database/StorageUtilization',
                'oci_autonomous_database/CurrentLogons',
                'oci_autonomous_database/DatabaseAvailability',
                'oci_autonomous_database/FailedLogons',
                'oci_autonomous_database/Sessions'
            )
        GROUP BY
            r.ArrayValue.metricName,
            TumblingWindow(minute, 1)
        This query:
        • Reads events from the Event Hub input.
        • Expands the nested records array.
        • Filters selected database health metrics.
        • Aggregates values in one-minute windows.
        • Writes processed output to Blob Storage.
    5. Complete the following steps to start the job.
      1. Navigate to Stream Analytics job and then select the job that you are using.
      2. Select the Start button.
      3. Choose Now as the Job output start time.
      4. Select the Start button.
      5. Confirm that the job starts successfully.
      This screenshot shows how to start a job.
  7. Verify Output in Azure Blob Storage

    After the Stream Analytics job starts and new events arrive:

    1. Open the storage account.
    2. Select the storage account name.
    3. Select Data storage > Containers.
    4. Open the container.
    5. Navigate to the generated folder.
    6. Open or download the JSON or CSV files.
    Example processed output:
    
    {"metricName":"oci_autonomous_database/DatabaseAvailability","AvgValue":1.0,"MaxValue":1.0,"MinValue":1.0,"Samples":3,"WindowEndTime":"2026-05-27T16:56:00.0000000Z"}
    {"metricName":"oci_autonomous_database/StorageUtilization","AvgValue":9.0,"MaxValue":9.0,"MinValue":9.0,"Samples":3,"WindowEndTime":"2026-05-27T16:56:00.0000000Z"}
    {"metricName":"oci_autonomous_database/CpuUtilization","AvgValue":0.0076,"MaxValue":0.0215,"MinValue":0.0,"Samples":3,"WindowEndTime":"2026-05-27T16:56:00.0000000Z"}