Disk encryption set troubleshooting

Varshney, Aayushi 0 Reputation points
2025-04-04T16:21:15.0033333+00:00

I am trying to use this command:

$ az vm create --name $VM_NAME --size $VM_SKU --resource-group $RG_NAME --location $RG_LOCATION --image $VM_IMAGE --os-disk-size-gb $VM_OS_DISK --storage-sku Standard_LRS --os-disk-encryption-set $VM_OS_DISK_ENCSET --attach-data-disks $DATA_DISK_NAME --generate-ssh-keys --output json --verbose --admin-username "localadmin" --admin-password $ADMINP --authentication-type "all" --nics $NIC_ID --priority Spot --max-price -1

344Argument '--max-price' is in preview. It may be changed/removed in a future release.

345SSH key files '/root/.ssh/id_rsa' and '/root/.ssh/id_rsa.pub' have been generated under ~/.ssh to allow SSH access to the VM. If using machines without permanent storage, back up your keys to a safe location.

error i am getting:

346Deployment failed. Correlation ID: ####. {

347 "error": {

348 "code": "OperationNotAllowed",

349 "message": "Managed disk encryption set resource id change for disk 'xd####vm1_OsDisk_1_####' via Virtual Machine 'xd####vm1' is not allowed. Please update disk resource at /subscriptions/####/resourceGroups/####/providers/Microsoft.Compute/disks/xd####vm1_OsDisk_####.",

350 "target": "diskEncryptionSets"

351 }

352}

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,713 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.