title: Issue in Creating windows virtual machine from customized Image created myself using azure CLI 2.0
body: <p>I am new to azure and I wanted to create new windows 2012 virtual machine from the image i just created using following steps. </p>
  
  <p>1) Created  w2k12 virtual machine using following  azure cli 2.0 cmd </p>
  
  <blockquote>
    <p>az vm create -n W2k12-host -g Naresh-test --image
    MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:latest 
    --vnet-name Naresh-test-vnet --subnet default --admin-username Administrator1 --admin-password R@ckware1234 --authentication-type
    password  --storage-account  nareshteststorage --use-unmanaged-disk
    --nsg Naresh-test-nsg</p>
  </blockquote>
  
  <p>once the virtual machine is successfully created ,RDP to the vm &amp; ran the sysprep script to make the vm as generalized .When  vm was in stopped state then i ran the following cmd to deallocate , make the vm state as generalized &amp;  verified the state of the vm is vm-genralized </p>
  
  <blockquote>
    <p>az vm deallocate --resource-group Naresh-test --name W2k12-host</p>
    
    <p>az vm generalize  --resource-group Naresh-test --name W2k12-host</p>
  </blockquote>
  
  <p><strong>I checked the image is in my resource group</strong> </p>
  
  <blockquote>
    <p>[root@Az-test-cli ~]# az image list Location    Name<br>
    ProvisioningState    ResourceGroup
    ----------  ---------------------------  -------------------  --------------- centralus   W2k12-Automation-host-image  Succeeded            NARESH-TEST</p>
  </blockquote>
  
  <p>when I tried to run the  az vm create using following cmd  </p>
  
  <blockquote>
    <p>az vm create -n Test-w2k12 -g Naresh-test --image
    W2k12-Automation-host-image  --vnet-name Naresh-test-vnet --subnet
    default --admin-username Administrator1 --admin-password R@ckware1234
    --authentication-type password   --nsg Naresh-test-nsg --debug --verbose</p>
  </blockquote>
  
  <p><strong>I get the following error</strong>  </p>
  
  <pre><code>At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details. {
    "status": "Failed",
    "error": {
      "code": "ResourceDeploymentFailure",
      "message": "The resource operation completed with terminal provisioning state 'Failed'.",
      "details": [
        {
          "code": "OSProvisioningTimedOut",
          "message": "OS Provisioning for VM 'Test-w2k12' did not finish in the allotted time. However, the VM guest agent was detected running. This suggests the guest OS has not been properly prepared to be used as a VM image (with CreateOption=FromImage). To resolve this issue, either use the VHD as is with CreateOption=Attach or prepare it properly for use as an image:\r\n * Instructions for Windows: https://azure.microsoft.com/documentation/articles/virtual-machines-windows-upload-image/ 
        }
      ]
    }
  }  Correlation ID: 2fa53bea-4aab-46d3-b989-972607754bb7
  </code></pre>
  
  <p>I am not sure am I missing any other steps , please suggested me  if we have any other guide or document for the windows virtual machine image creation and vm creation using the customized image using azure cli 2.0 </p>