无法从“az consumption”命令获得结果

Can't get result from `az consumption` command

我正在使用以下命令获取新创建资源的一些属性(例如 meterId)。

az consumption usage list --include-meter-details --query "[?contains(instanceName,'<resource name>')].meterId" -o json

但我得到的是空数组 [] 作为输出。我可以查询其他资源并获取它们的属性。它只发生在新创建的资源上。

我是否需要等待任何时间才能通过消费 cli 获取它们?

"[The consumption API data] is in the form of usage detail records which are currently emitted once per meter per resource per day"

Taken from Microsoft Docs for the Consumption API

因此,数据最多需要 24 小时才能显示,但根据 Microsoft 发布此数据的时间,可能需要更短的时间。