Azure / Azure/azure-cli

`timestamp` condition in `--analytics-query` does not seem to work

Open
#26,614 2 comments 0 reactions 1 assignee Claimed by @AllyW View on GitHub
act-observability-squad Auto-Assign Azure CLI Team customer-reported feature-request Monitor
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

When I execute a query like `traces | where timestamp >= datetime(2023-06-06 00:00:00)` at Azure Portal (Application Insights - Monitoring - Logs pane), I can get an expected result.

However, when I execute the same query using `az monitor app-insights query --analytics-query` command, I cannot get the same result. I have to specify a timestamp range using `--start-time` and `--end-time` option.

### Related command

[`az monitor app-insights query`](https://learn.microsoft.com/en-us/cli/azure/monitor/app-insights?view=azure-cli-latest#az-monitor-app-insights-query)

### Errors

Errors do not occur. Just I cannot get an expected result as same as executing a Kusto query at Azure Portal.

### Issue script & Debug output

Nothing.

### Expected behavior

I can get an expected result as same as executing a Kusto query at Azure Portal.

### Environment Summary

Here is my output.

```powershell
> az --version
azure-cli 2.49.0

core 2.49.0
telemetry 1.0.8

Extensions:
application-insights 0.1.19

Dependencies:
msal 1.20.0
azure-mgmt-resource 22.0.0

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory '$Env:USERPROFILE\.azure\cliextensions'

Python (Windows) 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:05:00) [MSC v.1929 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.