title: New-AzVM: Cannot parse the request
body: <p>While running the command in Azure PowerShell to craete a new VM, I am getting the following
  error:</p>
  <pre><code>New-AzureRmVM -ResourceGroupName $rg -Location $location -VM $vmconfig                                                                       
  New-AzVM: Cannot parse the request.                    
  ErrorCode: InvalidRequestFormat
  ErrorMessage: Cannot parse the request.
  ErrorTarget: 
  StatusCode: 400
  ReasonPhrase: Bad Request
  OperationID : c26d7a9a-ba6e-4be6-96b0-4350de7b2244
  </code></pre>
  <p><strong>Can someone please help, here what is missing? I used following configurations, before executing the New-AzureRmVM command:</strong></p>
  <pre><code>$vmSize = &quot;Standard_D1_V2&quot;
  $vmname = &quot;vm1&quot;
  $vmSize = &quot;Standard_D1_V2&quot; 
  $pubname = &quot;MicrosoftWindowsServer&quot;
  $offer = &quot;windowsserver&quot; 
  $sku = &quot;2012-R2-Datacenter&quot;
  $diskname = &quot;webVm10SDISK&quot;
  $cred = Get-Credential -message &quot;type the password&quot;
  $vmconfig = Set-AzureRmVMOperatingSystem -VM $vmconfig -windows -computername $vmname - 
  Credential $cred -ProvisionVMAgent -EnableAutoUpdate 
  $vmconfig = Set-AzureRmVMSourceImage -vm $vmconfig -PublisherName $pubname -Offer $offer -Skus 
  $sku -version &quot;latest&quot; 
  $vmconfig = Add-AzureRmVMNetworkInterface -VM $vmconfig -Id &quot;/subscriptions/1afeb8c3-6d3c- 
  4bb0-9afb-4957a83cfa54/resourceGroups/az-104-04- 
  rg1/providers/Microsoft.Network/networkInterfaces/vm1-nic/ipConfigurations/ipconfig1&quot;
  $OSDISKuri = $STA.PrimaryEndpoints.blob.toString() + &quot;vhds/&quot; + $diskname + &quot;.vhd&quot;
  $vmconfig = Set-AzureRmVMOSDisk -VM $vmconfig -Name $diskName -VhdUri $OSDiskUri -CreateOption 
  fromimage
  </code></pre>