title: How to use --attach-data-disks when creating new VM using Azure CLI2?
body: <p>I'm trying to create a new VM using existing Managed disks and I keep running into problems because the parameters are not very well documented.</p>
  
  <p>One problem that I haven't figured out is the format of --attach-data-disks</p>
  
  <p>From the name and description of the parameter this seems to be the way you can attach data disks to the VM that you are creating and I am assuming because it is --attach-data-disks and not --attach-data-disk that you can attach multiple disks using this parameter. </p>
  
  <p>What I don't know is what format to use when passing multiple disks. I have tried separating them using commas but the error that I got seemed to indicate that it viewed the comma delimited list of drives as one long name for a drive.</p>
  
  <p>Here is an example of what I am trying to do:</p>
  
  <pre><code>az vm create -g test-group -n testvm2 --os-type windows --attach-os-disk testvm1-osdisk-20181213-033052 --attach-data-disks "testvm1-datadisk-000-20181213-033052,testvm1-datadisk-001-20181213-033052,testvm1-datadisk-002-20181213-033052"
  </code></pre>
  
  <p>Error I'm getting:</p>
  
  <pre><code>Deployment failed. Correlation ID: 9999. {
    "error": {
      "code": "InvalidParameter",
      "message": "Id /subscriptions/99999999/resourceGroups/lbacompensafe/providers/Microsoft.Compute/disks/testvm1-datadisk-000-20181213-033052,testvm1-datadisk-001-20181213-033052,testvm1-datadisk-002-20181213-033052 is not a valid resource reference.",
      "target": "dataDisk.managedDisk.id"
    }
  }
  </code></pre>
  
  <p>I'm running the commands from Powershell, not Bash, if that makes a difference.</p>