Forum Discussion
Ashok42470
Mar 07, 2025Copper Contributor
Getting empty response while running a kql query using rest api
Hello All, Trying to run a KQL query using power via rest API by passing azure Entra app id and secret key. But we are getting empty response. Log analytics reader role is assigned on LA workspa...
Kidd_Ip
Mar 08, 2025MVP
May consider to modify your script slightly to capture and inspect the response for more insights:
try {
$response = Invoke-RestMethod -Uri $baseUri -Method Post -Headers $headers -Body $requestbody -Debug
Write-Host "Response:" -ForegroundColor Green
$response
} catch {
Write-Host "Error:" -ForegroundColor Red
$_.Exception.Message
$_.Exception.Response.Content | ConvertFrom-Json
}