title: Properly using Terraform External Data Source
body: <p>I am using Terraform from the bash cloud shell in Azure.  I am trying to add an external data source to my Terraform configuration file that will use <code>az cli</code> to query for the <code>virtualip</code> object on a Microsoft.Web/hostingEnvironment the template deploys.</p>
  
  <p>AZ CLI command line:
  <code>az resource show --ids /subscriptions/&lt;subscription Id&gt;/resourceGroups/my-ilbase-rg/providers/Microsoft.Web/hos
  tingEnvironments/my-ilbase/capacities/virtualip</code></p>
  
  <p>Output when run from command line:</p>
  
  <pre><code>   {
        "additionalProperties": {
          "internalIpAddress": "10.10.1.11",
          "outboundIpAddresses": [
            "52.224.70.119"
          ],
          "serviceIpAddress": "52.224.70.119",
          "vipMappings": []
        },
        "id": null,
        "identity": null,
        "kind": null,
        "location": null,
        "managedBy": null,
        "name": null,
        "plan": null,
        "properties": null,
        "sku": null,
        "tags": null,
        "type": null
      }
  </code></pre>
  
  <p>In my Terraform config I create a variable for the <code>--ids</code> value:</p>
  
  <pre><code>    variable ilbase_resourceId {
        default = "/subscriptions/&lt;subscription Id&gt;/resourceGroups/my-ilbase-rg/providers/Microsoft.Web/hostingEnvironments/my-ilbase/capacities/virtualip"
      }
  </code></pre>
  
  <p>I then have the data source structured this way:</p>
  
  <pre><code>    data "external" "aseVip" {
        program = ["az", "resource", "show", "--ids", "${var.ilbase_resourceId}"]
      }
  </code></pre>
  
  <p>When I execute my configuration, I get the error below:</p>
  
  <pre><code>    data.external.aseVip: data.external.aseVip: command "az" produced invalid JSON: json: cannot unmarshal object into Go value of type string
  </code></pre>
  
  <p>Any ideas what I am doing wrong?</p>