1

Unable to insert data from object array or csv file into kusto table

My goal is to build a pipeline in Azure DevOps which reads data using PowerShell and writes the data into Kusto Table.

I was able to write the data which I have read from PowerShell to object Array or csv file but I am unable to figure out the ways in which this data can be inserted into Kusto table.

Could any one suggest the best way to write the data into kusto

Joy
  • 1,171
  • 9
  • 15
A D
  • 51
  • 2
  • 12

1 Answers1

2

one option would be to write your CSV payload to blob storage, then ingest that blob into your target table, by:

  1. using a "queued ingestion" client in one of the client libraries: https://learn.microsoft.com/en-us/azure/kusto/api/
    • note that the .NET ingestion client library also provides you with methods to IngestFromStream or IngestFromDataReader, which handle writing the data to intermediate blob storage so that you don't have to

or by

  1. issuing an .ingest command: https://learn.microsoft.com/en-us/azure/kusto/management/data-ingestion/ingest-from-storage. though using "direction ingestion" is less recommended for Production volumes

another option (not recommended for Production volume), would be using the .ingest inline (AKA "ingest push") option: https://learn.microsoft.com/en-us/azure/kusto/management/data-ingestion/ingest-inline

for example:

.create table sample_table (a:string, b:int, c:datetime)

.ingest inline into table sample_table <|
hello,17,2019-08-16 00:52:07
world,71,2019-08-16 00:52:08
"isn't, this neat?",-13,2019-08-16 00:52:09

which will append the above records to the table:

| a                 | b    | c                           |
|-------------------|------|-----------------------------|
| hello             |  17  | 2019-08-16 00:52:07.0000000 |
| world             |  71  | 2019-08-16 00:52:08.0000000 |
| isn't, this neat? | -13  | 2019-08-16 00:52:09.0000000 |
Yoni L.
  • 22,627
  • 2
  • 29
  • 48