Search code examples
azureaz

Can't get result from `az consumption` command


I am using below command to get some properties (e.g meterId) of a newly created resource.

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

But i am getting empty array [] as output. I could query for other resources and get their properties. It's happening only for newly created resources.

Is there any timeframe i need to wait before i can get them through consumption cli ?


Solution

  • "[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

    So at most it should take, at most, 24 hours for the data to appear but depending on when Microsoft emit this data it could be a lesser amount of time.