Example of streaming data into Kusto cluster in Python.
-
Create a Kusto cluster, a database and a table to stream the data into. Don't forget to enable streaming ingestion for your cluster.
-
Register an Azure app. Just give it a name with no additional details like redirect URI, etc.
-
Allow your App to write to Kusto.
First, find 'Application (client) ID' and 'Directory (tenant) ID' GUIDs under 'Overview' page of your registered application in Azure.
Then, run the following command in your Kusto cluster:
.add table <YourTable> ingestors (@'aadapp=<Application (client) ID>;Directory (tenant) ID>') '<Your application name>'
- Setup Python virtual environment
python3 -mvenv venv
pip install -r requirements.txt
- Copy
config.ini.template
toconfig.ini
and fill-in all the details about your Kusto cluster, database, table and the app.
./send_empty_record.py