Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-51951

Azure cli doesn't support JMESpath query syntax

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: azure-cli-plugin
    • Labels:
      None
    • Environment:
      Jenkins version 2.124
      Azure CLI plugin version 0.7
      Azure CLI version 2.0.37 (installed via apt on Ubuntu 16.04)
    • Similar Issues:

      Description

      When trying to use jmespath syntax in the cli plugin, I get the error:

       

      Running: az vm list -g test-resource-group --show-details --query "[?contains(name, 'test-azure-cli')]".[powerState] -o tsv
      Failure: ERROR: az vm list: error: argument --query: invalid jmespath_type value: '"[?contains(name,'
      usage: az vm list [-h] [--verbose] [--debug] [--output {json,jsonc,table,tsv}]
                        [--query JMESPATH] [--resource-group RESOURCE_GROUP_NAME]
                        [--show-details]
      
      Build step 'azure-cli (2.0.37)' changed build result to FAILURE
      

        Attachments

          Activity

          Hide
          mbacchi Matt Bacchi added a comment -

          Actually if I remove the space between the name and string, such as below I get a different error:

          Running: az vm list -g test-resource-group --show-details --query "[?contains(name,'test-azure-cli')]".[powerState]
          Transforming to environment variables: /powerState|POWERSTATE
          Failure: No content to map due to end-of-input
           at [Source: ; line: 1, column: 0]
          Build step 'azure-cli (2.0.37)' changed build result to FAILURE
          
          Show
          mbacchi Matt Bacchi added a comment - Actually if I remove the space between the name and string, such as below I get a different error: Running: az vm list -g test-resource-group --show-details --query "[?contains(name, 'test-azure-cli' )]" .[powerState] Transforming to environment variables: /powerState|POWERSTATE Failure: No content to map due to end-of-input at [Source: ; line: 1, column: 0] Build step 'azure-cli (2.0.37)' changed build result to FAILURE

            People

            Assignee:
            torosent Tomer Rosenthal
            Reporter:
            mbacchi Matt Bacchi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: