Azure Policy to replace SSD by HDD possible ?

Clément Legoupil 21 Reputation points
2022-12-19T20:45:12.627+00:00

Hello everyone,

I'm discovering azure policies.

I'm administrator on my dev subscription, I would like to create a policy that will replace SSD disks of new or existing VM by HDD disks (dev env don't need SSDs), I've already create a policy that will deny SSD disks but the policy is triggered during the deployment and not at the 'Review and create' step.

I've tried to write a 'modify' policy but the error is : The policy definition 'xxxxxx' has operations referring to aliases that are not modifiable: 'Microsoft.Compute/disks/sku.name'.

Is there any way to prevent users to create VMs with SSDs ?

Thank you !

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
976 questions
0 comments No comments
{count} votes

Accepted answer
  1. Stanislav Zhelyazkov 26,936 Reputation points MVP
    2022-12-20T11:56:37.713+00:00

    Hi,
    Only option is to use deny policy for this. In order to use modify effect the alias needs to be supported as modifiable. In this case it is clearly not. Keep in mind that such action as changing the sku to another requires that the VM be stopped thus this is not suitable to be modifiable (even if it was possible) as for existing resource will not work if the VM is not stopped.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


0 additional answers

Sort by: Most helpful

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.