A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
Hello @Luke Rosser
I've made some changes to the template as below and this worked out for me pretty well to update the Network settings for OS disk of an existing VM.
Kindly test this out and let us know if this also fails for you.
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"diskName": {
"type": "String",
"metadata": {
"description": "Name of the existing disk"
}
},
"location": {
"type": "String",
"metadata": {
"description": "Location of the disk (e.g., 'eastus')"
}
},
"osType": {
"type": "String",
"metadata": {
"description": "OS type (e.g., 'Linux')"
}
},
"hyperVGeneration": {
"type": "String",
"metadata": {
"description": "HyperV generation (e.g., 'V2')"
}
},
"diskSizeGB": {
"type": "int",
"metadata": {
"description": "Disk size in GB (e.g., 30)"
}
},
"publicNetworkAccess": {
"type": "String",
"allowedValues": ["Enabled", "Disabled"]
},
"networkAccessPolicy": {
"type": "String",
"allowedValues": ["AllowAll", "AllowPrivate", "DenyAll"],
"defaultValue": "DenyAll"
},
"dataAccessAuthMode": {
"type": "String",
"defaultValue": "None",
"allowedValues": ["None", "AzureActiveDirectory"]
},
"imageReference": {
"type": "object",
"metadata": {
"description": "Image reference from disk's creationData"
}
}
},
"resources": [
{
"type": "Microsoft.Compute/disks",
"apiVersion": "2025-01-02",
"name": "[parameters('diskName')]",
"location": "[parameters('location')]",
"sku": {
"name": "Premium_LRS"
},
"properties": {
"osType": "[parameters('osType')]",
"hyperVGeneration": "[parameters('hyperVGeneration')]",
"creationData": {
"createOption": "FromImage",
"imageReference": "[parameters('imageReference')]"
},
"diskSizeGB": "[parameters('diskSizeGB')]",
"encryption": {
"type": "EncryptionAtRestWithPlatformKey"
},
"publicNetworkAccess": "[parameters('publicNetworkAccess')]",
"networkAccessPolicy": "[parameters('networkAccessPolicy')]",
"dataAccessAuthMode": "[parameters('dataAccessAuthMode')]"
}
}
]
}