'How to get/print the daily cap. of the app insights using azure powershell commands?

I tried the below commands but getting this error

https://aka.ms/cli_ref Read more about the command in reference docs

ERROR: argument --app/-a: expected one argument

Examples from AI knowledge base:

az monitor app-insights component billing show --app demoApp -g demoRg

Show the billing features of an application insights component

$sub=@(az account list --output tsv --query '[].[name]')

    ForEach($item in $sub)
   {
         az account set --subscription $i

 $a = az monitor app-insights component billing show --app $_.name -g $_.ResourceGroupName
 $a | foreach {
  az monitor app-insights component billing show --app $_.name -g $_.ResourceGroupName --output tsv --query '[dataVolumeCap.cap]'
}}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source