Skip to content

az monitor metrics list returns unhelpful message when start and end time are the same #6198

@ElvenSpellmaker

Description

@ElvenSpellmaker
/c/users/jblower [0] $ az monitor metrics list --resource /subscriptions/<id>/resourceGroups/POC-JACK-BS-METRICS/providers/Microsoft.Compute/virtualMachines/poc-jack-bs-metrics --metric 'CPU Credits Consumed,CPU Credits Remaining' --interval PT1M --start-time $(date -u +"%Y-%m-%dT%H:%M:%SZ" --date='1 minutes ago') --end-time $(date -u +"%Y-%m-%dT%H:%M:%SZ" --date='1 minute ago')
usage: az monitor metrics list [-h] [--verbose] [--debug]
                               [--output {tsv,table,json,jsonc}]
                               [--query JMESPATH] [--orderby ORDERBY]
                               [--resource-group RESOURCE_GROUP_NAME]
                               [--start-time START_TIME]
                               [--resource-parent PARENT] [--top TOP]
                               [--interval INTERVAL]
                               [--resource-namespace NAMESPACE]
                               [--aggregation [{Average,Count,Maximum,Minimum,Total} [{Average,Count,Maximum,Minimum,Total} ...]]]
                               [--metrics METRICNAMES [METRICNAMES ...]]
                               [--dimension [DIMENSION [DIMENSION ...]]]
                               [--filter FILTER] [--end-time END_TIME]
                               [--namespace METRICNAMESPACE] [--metadata]
                               [--resource-type RESOURCE_TYPE] --resource
                               RESOURCE_URI
az monitor metrics list: error: Input '2018-04-24 09:14:07' is not valid datetime. Valid example: 2000-12-31T12:59:59Z

This is the output when the start and end times are the same, it seems to believe that the time is invalid, which isn't the case. Also it's showing the time format as 2018-04-24 09:14:07 which is the internal format and isn't the format supplied which is confusing.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions