functions/Publish-JsonToADXTable.ps1

function Publish-JsonToADXTable {
    [CmdletBinding()]
    param (
        [System.String]
        $IngestUrl,

        [System.Guid]
        $ApplicationClientID,

        [System.String]
        $ApplicationclientKey,

        [System.Guid]
        $Authority,

        [System.String]
        $DatabaseName,

        [System.String]
        $TableName,

        [System.String]
        $FilePath
    )

    $KustoConnectionStringBuilder = [Kusto.Data.KustoConnectionStringBuilder]::new($ClusterUrl).WithAadApplicationKeyAuthentication(
        $ApplicationclientID,
        $ApplicationclientKey,
        $Authority
    )
    $KustoClient = [Kusto.Ingest.KustoIngestFactory]::CreateQueuedIngestClient(
        $KustoConnectionStringBuilder
    )
    $IngestionProperties = [Kusto.Ingest.KustoQueuedIngestionProperties]::new(
        $DatabaseName, 
        $TableName
    )
    $IngestionProperties.Format = [Kusto.Data.Common.DataSourceFormat]::Json
    $IngestionProperties.IgnoreFirstRecord = $true
    $IngestionResult = $KustoClient.IngestFromStorageAsync(
        $FilePath,
        $IngestionProperties
    )
    $IngestionResult.Result.GetIngestionStatusCollection()
}