Azure Database for MySQL
Azure Database for MySQL provides fully managed, enterprise-ready community MySQL database as a service. The service is developed and managed by Microsoft Corp.
The following table lists the data source offered by this integration.
||user authentication events are parsed|
||SQL requests are analyzed|
This setup guide will show you how to forward events produced by Azure MySQL service to Sekoia.io.
Theses changes have to be made from the Azure Web Portal.
Azure Event Hubs
As a prerequisite, you need to choose an existing “resource group”, or create a new one (e.g.
Retrieve your Subscription ID
You also need your “Subscription ID” if you don't have a default one. In Azure Web Portal, navigate to: “Home”, “Cost Management + Billing”, ”Subscriptions”. From there, copy the relevant “Subscription ID” that will be used in the command line (e.g.
Create the Event Hubs
Use Azure PowerShell (within Cloud Shell interface for example) to create a namespace (e.g.
company-eventhub) and a specific
Event Hub (e.g.
mysql-event) within your “resource group” (e.g.
PS Azure:\> az eventhubs namespace create --name company-eventhub --resource-group company-resource-group --enable-kafka true --subscription uuid
PS Azure:\> az eventhubs eventhub create --resource-group company-resource-group --namespace-name company-eventhub --name mysql-event --message-retention 3 --partition-count 4 --subscription uuid
Please replace :
company-resource-groupwith the name of your “resource group”.
uuidwith your subscription ID retrieved previously (see below).
Create “Shared Access Policies”
- Navigate to “Home”, “Event Hubs”, “company-eventhub - Shared access policies”. From there, you can create a policy (e.g.
RootManageSharedAccessKey) with the claims
Listen, and note the
Primary Keythat will be used as the
- Navigate to “Home”, “Event Hubs”, “company-eventhub”, “mysql-event - Shared access policies”. From there, you can create a policy (e.g.
sekoiaio) with the claims
Listen. Once created, click on the policy and save the
Connection string-primary key, to be sent to Sekoia.io.
- Navigate to “Home”, “Event Hubs”, “company-eventhub”, ”mysql-event - Consumer groups”. From there, you can create a consumer group (e.g.
Create a Blob Storage for Checkpointing
In order to allow Sekoia.io keep track of the consumed events, the next step consists in creating a dedicated Azure Blob Storage.
To proceed, you can use Azure PowerShell:
PS Azure:\> az storage account create --name "sekoiaiocheckpoint" --resource-group "company-resource-group"
PS Azure:\> az storage container create --name "mysql-event" --account-name "sekoiaiocheckpoint"
The container name, here
mysql-event should be the same as the Event Hub’s one.
You also need to replace
company-resource-group with the name of your “resource group”.
Finally, you have to retrieve the connection string from Azure Web Portal by going in “Storage Accounts”, then in the created storage (
sekoiaiocheckpoint) and finally in the “Access Keys” section. After clicking on “Show keys”, you can copy the first of the two connection strings.
You need to activate and configure the Azure MySQL diagnostic settings (e.g.
Navigate to “Home”, “SQL databases” (e.g.
company-mysql), “Monitoring” and “Diagnostic settings”:
- Add a new diagnostic setting, and select “Stream to an event hub” and click on configure.
- Select the previously created “Event hubs”, “Event Hub” and
- In the log section, select
- Choose a name for this configuration and click on “Save”.
Forward the Connection Keys to Sekoia.io
Finally, please send to Sekoia.io the following information:
- Azure Event Hub’s “Connection string-primary key” (e.g.
- Azure Event Hub’s consumer group name (e.g.
- Azure Blob Storage’s connection string (e.g.