I am using kusto .net SDK to write to kusto database using c#.. I am able to create the table as I please, but I wish to be able to write some rows to the database and populate the columns "a" and "b".. couldn't find an easy way to do this online..
static void Main(string[] args)
{
var KustoClusterConnectionString = $"xxxxxxxxxxxxxx";
var KustoDbName = "userGroup";
var AppId = "xxxxxxxxxxxxxxxxxxxxxxxxxxx";
var TenantId = "xxxxxxxxxxxxxxxxxxxxxxxxxxx";
var clientSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxxx";
var kcsb = new KustoConnectionStringBuilder(KustoClusterConnectionString)
{
InitialCatalog = KustoDbName,
FederatedSecurity = true,
ApplicationClientId = AppId,
ApplicationKey = clientSecret,
Authority = TenantId
};
var tableName = "userGroup";
using (var kustoClient = KustoClientFactory.CreateCslAdminProvider(kcsb))
{
var command =
CslCommandGenerator.GenerateTableCreateCommand(
tableName,
new[]
{
//Tuple.Create("TimeStamp", "System.DateTime"),
Tuple.Create("a", "System.String"),
Tuple.Create("b", "System.String"),
});
kustoClient.ExecuteControlCommand(KustoDbName, command);
}
}