azure-cli-extensions icon indicating copy to clipboard operation
azure-cli-extensions copied to clipboard

az monitor log-analytics query is very picky about kusto queries

Open arkady69 opened this issue 1 year ago • 1 comments

$query = 'AzureDiagnostics | where action_s == "Blocked" | count'

$w = 'valid--id'

Invoke-AzOperationalInsightsQuery -WorkspaceId $w -Query $query -ErrorAction Stop -Timespan (New-TimeSpan -Hours 2)| Select-Object -ExpandProperty Results --> produces Count

123

'az monitor log-analytics query -w $w --analytics-query $query -t PT3H ' produces -> BadArgumentError: The request had some invalid properties

its a valid kusto query. the powershell cmdlet produces a result. az cli breaks.

Why?

arkady69 avatar Jul 22 '22 23:07 arkady69

monitor

yonzhan avatar Jul 23 '22 06:07 yonzhan