title: Azure VM custom OS image ARM template deployment
body: <p>Till now I have been using the market place Suse SLES for SAP image to create my VMs. However now I intend to use a golden OS image that contains additional software and configuration. For that I created a VM with the market place image and configured it. Then I created an image with just the OS disk <a href="https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image" rel="nofollow noreferrer">Linux image creation</a>. It seems MS is going towards VM image instead of the earlier disk image. However I cannot find any way to use this VM image as part of ARM template deployment. Previously I was using the standard template as below:</p>
  
  <pre><code> "osProfile": {
                  "computerName": "[parameters('vmName')]",
                  "adminUsername": "[parameters('vmUserName')]",
                  "adminPassword": "[parameters('vmPassword')]"
              },
              "storageProfile": {
                  "imageReference": {
                      "publisher": "[variables('OperatingSystemSpec').imagePublisher]",
                      "offer": "[variables('OperatingSystemSpec').imageOffer]",
                      "sku": "[variables('OperatingSystemSpec').sku]",
                      "version": "latest"
                  },
                  "osDisk": {
                      "name": "[concat(parameters('vmName'),'-OS')]",
                      "createOption": "FromImage",
                      "caching": "ReadWrite",
                      "managedDisk": {
                          "storageAccountType": "Premium_LRS"
                      } 
                  }
  </code></pre>
  
  <p>How do I use the generalized golden image from my template?</p>
  
  <p>The objective is that my golden image should be usable just like I am using the market place images otherwise there will be a big change in all ARM templates. Can I somehow publish my images just like the market place images (but as a private collection) so that it is usable like one of them?</p>
  
  <p>Do I need to create a VHD image for this kind of usage? I see there are ARM template examples that are able to refer to VHDs stored in azure storage. How do I create a VHD for my Azure VM OS disk? I see examples that show how to create and upload VHDs but those are for on-prem VMs. Also do note I am using managed disks for my Azure VMs.</p>
  
  <p>Any help much appreciated.. </p>