in packages/quick_start/src/SampleApp.ts [263:290]
private static async ingestion(config: ConfigJson, kustoClient: KustoClient, ingestClient: IngestClient) {
for (const dataFile of config.data) {
const dfVal: string = dataFile.format.toLowerCase();
let dataFormat: DataFormat;
if (Object.values(DataFormat).some((val: string) => val === dfVal)) {
dataFormat = dfVal as DataFormat;
} else {
Utils.errorHandler(`Invalid data format: ${dfVal}`);
}
const mappingName = dataFile.mappingName;
// Tip: This is generally a one-time configuration. Learn More: For more information about providing inline mappings and mapping references,
// see: https://docs.microsoft.com/azure/data-explorer/kusto/management/mappings
await this.createIngestionMappings(
dataFile.useExistingMapping,
kustoClient,
config.databaseName,
config.tableName,
mappingName,
dataFile.mappingValue,
dataFormat,
);
// Learn More: For more information about ingesting data to Kusto in C#,
// see: https://docs.microsoft.com/en-us/azure/data-explorer/net-sdk-ingest-data
await this.ingestData(dataFile, dataFormat, ingestClient, config.databaseName, config.tableName, mappingName, config.ignoreFirstRecord);
}
await Ingestion.waitForIngestionToComplete(config.waitForIngestSeconds);
}