官方非常confused的API https://github.com/Azure/azure-kusto-python/blob/master/azure-kusto-ingest/tests/sample.py
data = pd.DataFrame(data=[['zz',1],['b', 2]], columns=['name', 'age'])
cluster = "https://ingest-<cluster_name>.kusto.windows.net"
ingestion_props = IngestionProperties(database="cluster_name", table="table_name", dataFormat=DataFormat.csv)
kscb = KustoConnectionStringBuilder.with_aad_application_key_authentication(
cluster, configkey.client_id, configkey.client_secret, configkey.authority_id)
client = KustoIngestClient(kscb)
client.ingest_from_dataframe(data, ingestion_properties=ingestion_props)
主要注意:
1.如果要把数据写到cluster_name中, cluster link中cluste_name前要加ingest-
2. dataFormat=DataFormat.csv
中的csv是小写,API上大写有错