无法将数据从对象数组或 csv 文件插入到 kusto 表中
我的目标是在 Azure DevOps 中构建一个管道,该管道使用 PowerShell 读取数据并将数据写入 Kusto Table。
我能够将从PowerShell读取的数据写入对象数组或csv文件,但我无法弄清楚将此数据插入Kusto表的方法。
任何人都可以建议将数据写入kusto的最佳方法
一种选择是将 CSV 有效负载写入 Blob 存储,然后将该 Blob 引入目标表,方法是:
- 在其中一个客户端库中使用"排队引入"客户端:https://learn.microsoft.com/en-us/azure/kusto/api/
- 请注意,.NET 引入客户端库还提供了用于
IngestFromStream
或IngestFromDataReader
的方法,这些方法处理将数据写入中间 blob 存储,因此你不必
- 请注意,.NET 引入客户端库还提供了用于
或由
- 发出
.ingest
命令: https://learn.microsoft.com/en-us/azure/kusto/management/data-ingestion/ingest-from-storage,但不太建议对生产卷使用"方向摄取">
另一个选项(不建议用于生产量(是使用.ingest inline
(又名"摄取推送"(选项:https://learn.microsoft.com/en-us/azure/kusto/management/data-ingestion/ingest-inline
例如:
.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
这会将上述记录附加到表中:
| 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 |