我设法使用以下代码成功提取数据
var kcsbDM =新的kustoConnectionStringBuilder(“ https://test123.southeastasia.kusto.windows.net”,“ testdb”)。WithAadApplicationTokenAuthentication(acquireTokenTask.accessToken);
使用(var ingestClient = kustoIngestFactory.CreateDirectIngestClient(kcsbDM))
{
var ingestProps = new kustoQueuedIngestionProperties("testdb","TraceLog");
ingestProps.ReportLevel = IngestionReportLevel.FailuresOnly;
ingestProps.ReportMethod = IngestionReportMethod.Queue;
ingestProps.Format = DataSourceFormat.json;
//generate datastream and columnmapping
ingestProps.Ingestionmapping = new Ingestionmapping() { Ingestionmappings = columnmappings };
var ingestionResult = ingestClient.IngestFromStream(memStream,ingestProps);
}
当我尝试使用QueuedClient和IngestFromStreamAsync时,代码已成功执行,但即使30分钟后也没有任何数据被摄取到数据库中
var kcsbDM =新的kustoConnectionStringBuilder(“ https://ingest-test123.southeastasia.kusto.windows.net”,“ testdb”)。WithAadApplicationTokenAuthentication(acquireTokenTask.accessToken);
使用(var ingestClient = kustoIngestFactory.CreateQueuedIngestClient(kcsbDM))
{
var ingestProps = new kustoQueuedIngestionProperties("testdb","TraceLog");
ingestProps.ReportLevel = IngestionReportLevel.FailuresOnly;
ingestProps.ReportMethod = IngestionReportMethod.Queue;
ingestProps.Format = DataSourceFormat.json;
//generate datastream and columnmapping
ingestProps.Ingestionmapping = new Ingestionmapping() { Ingestionmappings = columnmappings };
var ingestionResult = ingestClient.IngestFromStreamAsync(memStream,ingestProps);
}