Skip to content

Commit 2f336ba

Browse files
out_azure_kusto: added workload identity auth mode
Signed-off-by: Tanmaya Panda <[email protected]>
1 parent 412b444 commit 2f336ba

File tree

1 file changed

+83
-27
lines changed

1 file changed

+83
-27
lines changed

pipeline/outputs/azure_kusto.md

Lines changed: 83 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,40 @@ description: Send logs to Azure Data Explorer (Kusto)
66

77
The Kusto output plugin allows to ingest your logs into an [Azure Data Explorer](https://azure.microsoft.com/en-us/services/data-explorer/) cluster, via the [Queued Ingestion](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/api/netfx/about-kusto-ingest#queued-ingestion) mechanism. This output plugin can also be used to ingest logs into an [Eventhouse](https://blog.fabric.microsoft.com/en-us/blog/eventhouse-overview-handling-real-time-data-with-microsoft-fabric/) cluster in Microsoft Fabric Real Time Analytics.
88

9+
## Authentication Methods
10+
11+
Fluent-Bit can use various authentication methods to connect to your Azure Data Explorer cluster:
12+
13+
### Service Principal Authentication (Default)
14+
15+
For service principal authentication, you'll need to create an Azure AD application:
16+
17+
- [Register an Application](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app#register-an-application)
18+
- [Add a client secret](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app#add-a-client-secret)
19+
- [Authorize the app in your database](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/management/access-control/principals-and-identity-providers#azure-ad-tenants)
20+
21+
Configure Fluent Bit with your application's `tenant_id`, `client_id`, and `client_secret`.
22+
23+
### Managed Identity Authentication
24+
25+
When running on Azure services that support Managed Identities (such as Azure VMs, AKS, or App Service):
26+
27+
1. [Assign the managed identity appropriate permissions to your Kusto database](https://learn.microsoft.com/en-us/azure/data-explorer/configure-managed-identities-cluster)
28+
2. Configure Fluent Bit with `auth_type` set to `managed_identity`
29+
3. For system-assigned identity, set `client_id` to `system`
30+
4. For user-assigned identity, set `client_id` to the managed identity's client ID (GUID)
31+
32+
### Workload Identity Authentication
33+
34+
For Kubernetes environments using Azure Workload Identity:
35+
36+
1. [Set up Azure Workload Identity in your Kubernetes cluster](https://learn.microsoft.com/en-us/azure/aks/workload-identity-deploy-cluster)
37+
2. Configure your pod to use a service account with Workload Identity Federation
38+
3. Configure Fluent Bit with:
39+
- `auth_type` set to `workload_identity`
40+
- `tenant_id` and `client_id` of your Azure AD application
41+
- `workload_identity_token_file` pointing to your token file path (typically `/var/run/secrets/azure/tokens/azure-identity-token`)
42+
943
## For ingesting into Azure Data Explorer: Creating a Kusto Cluster and Database
1044

1145
You can create an Azure Data Explorer cluster in one of the following ways:
@@ -20,15 +54,6 @@ You can create an Eventhouse cluster and a KQL database follow the following ste
2054
- [Create an Eventhouse cluster](https://docs.microsoft.com/en-us/azure/data-explorer/eventhouse/create-eventhouse-cluster)
2155
- [Create a KQL database](https://docs.microsoft.com/en-us/azure/data-explorer/eventhouse/create-database)
2256

23-
24-
## Creating an Azure Registered Application
25-
26-
Fluent-Bit will use the application's credentials, to ingest data into your cluster.
27-
28-
- [Register an Application](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app#register-an-application)
29-
- [Add a client secret](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app#add-a-client-secret)
30-
- [Authorize the app in your database](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/management/access-control/principals-and-identity-providers#azure-ad-tenants)
31-
3257
## Creating a Table
3358

3459
Fluent-Bit ingests the event data into Kusto in a JSON format, that by default will include 3 properties:
@@ -51,11 +76,12 @@ By default, Kusto will insert incoming ingestions into a table by inferring the
5176

5277
| Key | Description | Default |
5378
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
54-
| tenant_id | _Required if `managed_identity_client_id` is not set_ - The tenant/domain ID of the AAD registered application. | |
55-
| client_id | _Required if `managed_identity_client_id` is not set_ - The client ID of the AAD registered application. | |
56-
| client_secret | _Required if `managed_identity_client_id` is not set_ - The client secret of the AAD registered application ([App Secret](https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret)). |
57-
| managed_identity_client_id | _Required if `tenant_id`, `client_id`, and `client_secret` are not set_ - The managed identity ID to authenticate with. Set to `SYSTEM` for system-assigned managed identity, or set to the MI client ID (GUID) for user-assigned managed identity. | |
58-
| ingestion_endpoint | _Required_ - The cluster's ingestion endpoint, usually in the form `https://ingest-cluster_name.region.kusto.windows.net |
79+
| tenant_id | _Required for service principal and workload identity auth_ - The tenant/domain ID of the AAD registered application. | |
80+
| client_id | _Required for service principal and workload identity auth_ - The client ID of the AAD registered application. When using managed identity authentication, set this to 'system' for system-assigned identity or provide the managed identity's client ID. | |
81+
| client_secret | _Required for service principal auth_ - The client secret of the AAD registered application ([App Secret](https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret)). | |
82+
| workload_identity_token_file | _Required for workload identity auth_ - The file path containing the workload identity token when using Azure Workload Identity authentication in Kubernetes. | /var/run/secrets/azure/tokens/azure-identity-token |
83+
| auth_type | Authentication type to use. Supported values: `service_principal` (default), `managed_identity`, `workload_identity`. | `service_principal` |
84+
| ingestion_endpoint | _Required_ - The cluster's ingestion endpoint, usually in the form `https://ingest-cluster_name.region.kusto.windows.net` | |
5985
| database_name | _Required_ - The database name. | |
6086
| table_name | _Required_ - The table name. | |
6187
| ingestion_mapping_reference | _Optional_ - The name of a [JSON ingestion mapping](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/management/mappings#json-mapping) that will be used to map the ingested payload into the table columns. | |
@@ -83,7 +109,9 @@ By default, Kusto will insert incoming ingestions into a table by inferring the
83109

84110
### Configuration File
85111

86-
Get started quickly with this configuration file:
112+
Get started quickly with these configuration examples:
113+
114+
#### Service Principal Authentication (Default)
87115

88116
```
89117
[OUTPUT]
@@ -99,18 +127,46 @@ Get started quickly with this configuration file:
99127
ingestion_endpoint_connect_timeout <ingestion_endpoint_connect_timeout>
100128
compression_enabled <compression_enabled>
101129
ingestion_resources_refresh_interval <ingestion_resources_refresh_interval>
102-
buffering_enabled On
103-
upload_timeout 2m
104-
upload_file_size 125M
105-
azure_kusto_buffer_key kusto1
106-
buffer_file_delete_early Off
107-
unify_tag On
108-
buffer_dir /var/log/
109-
store_dir_limit_size 16GB
110-
blob_uri_length 128
111-
scheduler_max_retries 3
112-
delete_on_max_upload_error Off
113-
io_timeout 60s
130+
buffering_enabled <buffering_enabled>
131+
upload_timeout <upload_timeout>
132+
upload_file_size <upload_file_size>
133+
azure_kusto_buffer_key <azure_kusto_buffer_key>
134+
buffer_file_delete_early <buffer_file_delete_early>
135+
unify_tag <unify_tag>
136+
buffer_dir <buffer_dir>
137+
blob_uri_length <blob_uri_length>
138+
scheduler_max_retries <scheduler_max_retries>
139+
delete_on_max_upload_error <delete_on_max_upload_error>
140+
```
141+
142+
#### Managed Identity Authentication
143+
144+
```
145+
[OUTPUT]
146+
Match *
147+
Name azure_kusto
148+
Auth_Type managed_identity
149+
Client_Id <managed_identity_client_id> # Use 'system' for system-assigned managed identity
150+
Ingestion_Endpoint https://ingest-<cluster>.<region>.kusto.windows.net
151+
Database_Name <database_name>
152+
Table_Name <table_name>
153+
# Additional parameters as needed
154+
```
155+
156+
#### Workload Identity Authentication
157+
158+
```
159+
[OUTPUT]
160+
Match *
161+
Name azure_kusto
162+
Auth_Type workload_identity
163+
Tenant_Id <tenant_id>
164+
Client_Id <client_id>
165+
Workload_Identity_Token_File /var/run/secrets/azure/tokens/azure-identity-token
166+
Ingestion_Endpoint https://ingest-<cluster>.<region>.kusto.windows.net
167+
Database_Name <database_name>
168+
Table_Name <table_name>
169+
# Additional parameters as needed
114170
```
115171

116172
## Troubleshooting

0 commit comments

Comments
 (0)