Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Client, KustoConnectionStringBuilder, ClientRequestProperties } from 'azure-kusto-data';
const connectionString = "https://clustername.kusto.windows.net";
const kcsb = KustoConnectionStringBuilder.withAadApplicationKeyAuthentication(connectionString, 'appid', 'appkey', 'authorityId');
const client1 = new Client(kcsb);
client1.execute("db", "TableName | limit 1", (err, results) => {
if (err) throw err;
console.log(results.primaryResults[0].toString());
});
KustoConnectionStringBuilder.withAadApplicationKeyAuthentication(connectionString, 'appid', 'appkey', 'authorityId');
KustoConnectionStringBuilder.withAadApplicationCertificateAuthentication(connectionString, 'appid', 'certificate', 'thumbprint', 'authorityId');
KustoConnectionStringBuilder.withAadManagedIdentities(connectionString);
KustoConnectionStringBuilder.withAadManagedIdentities(connectionString, 'msi_endpoint', 'msi_secret');
KustoConnectionStringBuilder.withAadUserPasswordAuthentication(connectionString, 'username', 'password');
KustoConnectionStringBuilder.withAadUserPasswordAuthentication(connectionString, 'username', 'password', 'authorityId');
KustoConnectionStringBuilder.withAadDeviceAuthentication(connectionString, 'authId');
KustoConnectionStringBuilder.withAadDeviceAuthentication(connectionString, 'authId', tokenResponse => {
console.log(`Open ${tokenResponse.verificationUrl} and use ${tokenResponse.userCode} code to authorize.`);
});
const client2 = new Client("http://cluster.region.kusto.windows.net");
const clientRequestProps = new ClientRequestProperties();
clientRequestProps.setOption("servertimeout", 1000 * 60);
client2.executeQuery("db", "Table | count", (err: any, results: any) => {
console.log(results);
}, clientRequestProps);
import { Client, KustoConnectionStringBuilder, ClientRequestProperties } from 'azure-kusto-data';
const connectionString = "https://clustername.kusto.windows.net";
const kcsb = KustoConnectionStringBuilder.withAadApplicationKeyAuthentication(connectionString, 'appid', 'appkey', 'authorityId');
const client1 = new Client(kcsb);
client1.execute("db", "TableName | limit 1", (err, results) => {
if (err) throw err;
console.log(results.primaryResults[0].toString());
});
KustoConnectionStringBuilder.withAadApplicationKeyAuthentication(connectionString, 'appid', 'appkey', 'authorityId');
KustoConnectionStringBuilder.withAadApplicationCertificateAuthentication(connectionString, 'appid', 'certificate', 'thumbprint', 'authorityId');
KustoConnectionStringBuilder.withAadManagedIdentities(connectionString);
KustoConnectionStringBuilder.withAadManagedIdentities(connectionString, 'msi_endpoint', 'msi_secret');
KustoConnectionStringBuilder.withAadUserPasswordAuthentication(connectionString, 'username', 'password');
KustoConnectionStringBuilder.withAadUserPasswordAuthentication(connectionString, 'username', 'password', 'authorityId');
KustoConnectionStringBuilder.withAadDeviceAuthentication(connectionString, 'authId');
KustoConnectionStringBuilder.withAadDeviceAuthentication(connectionString, 'authId', tokenResponse => {
console.log(`Open ${tokenResponse.verificationUrl} and use ${tokenResponse.userCode} code to authorize.`);
});
database: "Database",
table: "Table",
format: DataFormat.JSON,
ingestionMapping : [
new JsonColumnMapping("TargetColumn1", "$.sourceProp1"),
new JsonColumnMapping("TargetColumn2", "$.sourceProp2"),
new JsonColumnMapping("TargetColumn3", "$.sourceProp3")
],
ingestionMappingType: IngestionMappingType.JSON,
reportLevel: ReportLevel.FailuresAndSuccesses,
reportMethod: ReportMethod.Queue
});
const ingestClient = new IngestClient(
KustoConnectionStringBuilder.withAadApplicationKeyAuthentication(
`https://ingest-${clusterName}.kusto.windows.net`, appId, appKey, authorityId
),
props
);
const statusQueues = new IngestStatusQueues(ingestClient);
function waitForFailures() {
statusQueues.failure.isEmpty((err, empty) => {
if (err) throw new Error(err);
if (empty) {
console.log("no errors...");
return setTimeout(waitForFailures, 1000);
}
else {