Set osDisk size when deploying a VM in Azure

If you need a larger OS disk, at deployment, for your VM you can add {“diskSizeGB”: integer} under osDisk in an ARM deployment template. This is an easy way to increase the size of the OS disk when creating a VM.

Below is an example from an ARM deployment template for an Ubuntu VM.

"storageProfile": {
                    "osDisk": {
                        "createOption": "fromImage",
                        "diskSizeGB": 512,
                        "managedDisk": {
                            "storageAccountType": "[parameters('osDiskType')]"
                        }
                    },

For more information and example visit: https://docs.microsoft.com/en-us/azure/templates/microsoft.compute/virtualmachines

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.