This template creates a new encrypted windows vm using the server 2k12 gallery image.
{"apiversion": "2019-07-01", "type": "microsoft.compute/virtualmachines", "name": "[parameters('vmname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/networkinterfaces/", variables('nicname'))]"], "identity": {"type": "systemassigned"}, "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "osprofile": {"computername": "[parameters('vmname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[variables('ossku')]", "version": "latest"}, "osdisk": {"createoption": "fromimage"}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",variables('nicname'))]"}]}}}{"type": "microsoft.compute/virtualmachines/extensions", "name": "[concat(parameters('vmname'),"/diskencryption')]", "apiversion": "2019-03-01", "dependson": ["[resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))]"], "location": "[parameters('location')]", "properties": {"publisher": "microsoft.azure.security", "type": "azurediskencryption", "typehandlerversion": "2.2", "autoupgrademinorversion": true, "settings": {"encryptionoperation": "[variables('encryptionoperation')]", "keyvaulturl": "[variables('keyvaulturl')]", "keyvaultresourceid": "[variables('keyvaultresourceid')]", "volumetype": "all"}}} 