Error message"Changing property 'imageReference' is not allowed."}]}} in Azure Student

Deborah Berube 0 Reputation points
2025-02-10T17:10:31.5+00:00

I am working in Azure Student and trying have created a VM. I am trying to generate ssh keys and keep getting this error: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/815b37e5-b202-482e-90dd-af9ffbf4c6dd/resourceGroups/NewLearner/providers/Microsoft.Resources/deployments/vm_deploy_56edZxBG1RmfMvRzTXd04UIq6DwQKxxS","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"PropertyChangeNotAllowed","target":"imageReference","message":"Changing property 'imageReference' is not allowed."}]}}

I have not changed the Image when setting up my Resource Group or VM. I used the default. I have tried to fix this situation myself but can't get it to work. Can someone help? Thanks!

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

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 28,381 Reputation points
    2025-02-10T22:25:38.23+00:00

    If you are using an ARM template to deploy the VM, verify that the imageReference property is not being modified in subsequent deployments because it must remain consistent with the initial deployment.

    If the VM is not yet in production and you can afford to recreate it, consider deleting the existing VM and deploying a new one with the correct imageReference from the start.

    1. Delete the existing VM.
    2. Make sure that the imageReference in your deployment template or configuration is set correctly.
    3. Redeploy the VM.

    If the issue is related to generating SSH keys, you can use Azure CLI or PowerShell to generate the keys separately and then associate them with your VM.

    az sshkey create --name "mySSHKey" --resource-group "NewLearner"
    
    New-AzSshKey -ResourceGroupName "NewLearner" -Name "mySSHKey"
    

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.