Architecture diagram

Requirements
- The Azure CLI configured. If you have not already, follow the instructions below.
- An Azure Subscription
-
The following providers must be registered in the Azure Subscription. If they are not registered, do so using:
az provider register --namespace <resource-provider-namespace> --subscription <subscription_id>Microsoft.InsightsMicrosoft.EventHub
- Administrative access to an Azure Subscription, specifically the permissions listed below.
Microsoft.EventHub/checkNameAvailability/actionMicrosoft.EventHub/register/actionMicrosoft.EventHub/namespaces/writeMicrosoft.EventHub/namespaces/readMicrosoft.EventHub/namespaces/authorizationRules/readMicrosoft.EventHub/namespaces/authorizationRules/writeMicrosoft.EventHub/namespaces/eventhubs/writeMicrosoft.EventHub/namespaces/eventhubs/readMicrosoft.EventHub/namespaces/eventhubs/authorizationRules/readMicrosoft.EventHub/namespaces/eventhubs/authorizationRules/write
Using Terraform
1. Initialize the Azure EDS Terraform Module
We provide a Terraform module that configures most of the required resources for you. To get started, copy the following Terraform snippet.2. Create a diagnostic setting at the root management group
For this step, we will need to use the Azure REST API, as this functionality is not available anywhere else. You can trigger this using any REST client you prefer. An authorization token is required, which you can retrieve from the Azure CLI using the following command:<root-management-group-ID>: The root management group for your Azure directory<diagnostic-setting-name>: Any name<event-hub-subscription>: The subscription under which you created your event hub namespace<event-hub-resource-group>: The resource group under which you created your event hub namespace<event-hub-namespace-name>: The name of your event hub namespace<authorization-rule-name>: The name of the authorization rule configured above<event-hub-name>: The name of the event hub configured above
3. Allow the Opal App Registration to read from your Event Hub
Now we need to allow the Opal Service to read from your Azure Event Hub. Fill in the following command:<opal-app-registration-object-id>: The object ID of the App Registration you use for Opal.<event-hub-id>: The ID of the created event hub that was output from your terraform apply
4. Connect Opal to your Event Hub
Go to your Azure app in Opal, select Setup, and click Edit to configure your event hub:- Event Hub Namespace: This must be the fully-qualified name of your event hub namespace. It will be of the form
<your-event-hub-namespace-name>.servicebus.windows.net - Event Hub Name: Your event hub’s name, as returned from the terraform apply.

Using Azure Portal
1. Create an Azure Event Hub Namespace
Go to Event Hubs and click +Create.
- Subscription: The subscription your event hub namespace is only affects where it is billed.
- Resource Group
- Namespace name
- Location
- Pricing Tier: Note that this affects the length of the data retention periods that you are eligible for
- Throughput Units: 1 TU is recommended

2. Create an Event Hub
Once your event hub namespace is deployed, go to it in the Azure UI and click + Event Hub.
- Name
- Partition Count: We recommend setting the partition count to 1
- Cleanup Policy: Controls what happens when events reach their retention limit. We recommend using Delete
- Retention Time: The maximum retention period available to you will differ based on the pricing tier you chose in step 1. We recommend using the longest retention period possible.

3. Set up authorization rules
Authorization rules allow Azure to push audit and administrative logs to your event hub, see here for more details. Fill in the following fields in the command below to create an authorization rule on your namespace<authorization-rule-name>: Can be any name<event-hub-namespace-name>: Name of the event hub namespace configured above<event-hub-resource-group>: Resource group under which the event hub namespace was created
4. Create a diagnostic setting at the root management group
For this step, we will need to use the Azure REST API. You can trigger this via any REST client you would like. An authorization token is required, which you can retrieve from the Azure CLI using the following command:<root-management-group-ID>: The root management group for your Azure directory<diagnostic-setting-name>: Any name<event-hub-subscription>: The subscription under which you created your event hub namespace<event-hub-resource-group>: The resource group under which you created your event hub namespace<event-hub-namespace-name>: The name of your event hub namespace<authorization-rule-name>: The name of the authorization rule configured above<event-hub-name>: The name of the event hub configured above
5. Enable Microsoft Entra Logging
Go to Microsoft Entra and click Show More on the left hand bar.


- Diagnostic setting name
- Log Categories: Select AuditLogs
- Destination details: Select Stream to an event hub
- Select the subscription, event hub namespace, event hub and authorization rule created above

6. Allow the Opal App Registration to read from your Event Hub
Now we need to allow the Opal Service to read from your Azure Event Hub. Fill in the following command:<opal-app-registration-object-id>: The object ID of the App Registration you use for Opal.<event-hub-id>: The ID of the created event hub
7. Connect Opal to your Event Hub
Go to your Azure app in Opal, select Setup and click Edit to configure your event hub:- Event Hub Namespace: This must be the fully-qualified name of your event hub namespace. It will be of the form
<your-event-hub-namespace-name>.servicebus.windows.net - Event Hub Name: Your event hub’s name

