title: Azure CLI returning second array when only expecting one
body: <p>I'm working with azure CLI to script out a storage upgrade as well as add a policy, all in a python script. However, when I run the script I'm getting some expected and some very NOT expected output.</p>
  <p>What I'm using so far:</p>
  <pre><code>from azure.cli.core import get_default_cli
  
  def az_cli (args_str):
      args = args_str.split()
      cli = get_default_cli()
      cli.invoke(args)
      if cli.result.result:
          return cli.result.result
      elif cli.result.error:
          raise cli.result.error
      return True
  
  sas = az_cli(&quot;storage account list --query [].{Name:name,ResourceGroup:resourceGroup,Kind:kind}&quot;)
  
  print(sas)
  </code></pre>
  <p>By using <a href="https://stackoverflow.com/questions/51546073/how-to-run-azure-cli-commands-using-python">this SO</a> article as reference I'm pretty easily making Azure CLI calls, however my output is the following:</p>
  <pre><code>[
  {
      &quot;Kind&quot;: &quot;StorageV2&quot;,
      &quot;Name&quot;: &quot;TestStorageName&quot;,
      &quot;ResourceGroup&quot;: &quot;my_test_RG&quot;
    },
    {
      &quot;Kind&quot;: &quot;Storage&quot;,
      &quot;Name&quot;: &quot;TestStorageName2&quot;,
      &quot;ResourceGroup&quot;: &quot;my_test_RG_2&quot;
    }
  ]
  [OrderedDict([('Name', 'TestStorageName'), ('ResourceGroup', 'my_test_RG'), ('Kind', 'StorageV2')]), OrderedDict([('Name', 'TestStorageName2'), ('ResourceGroup', 'my_test_RG_2'), ('Kind', 'Storage')])]
  </code></pre>
  <p>I appear to be getting 2 arrays back, and I'm unsure of what the cause is. I'm assuming it has to do with my using the --query to narrow down the output I get back, but I'm at a loss as to why it then repeats itself. Expected result would just be the first part that's in json format. I have also tried with tsv output as well with the same results. I appreciate any insight!</p>