VM deployment: Please register the Subscription for 'Microsoft.Compute/VMCustomizationPreview' to use the feature.

Ronny Forberger 45 Reputation points
2023-08-12T08:19:30.7166667+00:00

I wanted to deploy a VM usig Bicep and Azure DevOps, but I get the ollowing error message:

ERROR: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/REDACTED/resourceGroups/vmapp/providers/Microsoft.Resources/deployments/main","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see 
##[error]Script failed with exit code: 1

Looks like the feature

Microsoft.Compute/VMCustomizationPreview

is not enabled in the preview features in my subscription, but when I want to add the feature in 'Preview features' in the subscription, I do not find it in the drop down list in the portal.

I am using az cli version 2.51.0 script type pscore.

What can be wrong?

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

Accepted answer
  1. kobulloc-MSFT 26,626 Reputation points Microsoft Employee
    2023-08-21T17:30:28.91+00:00

    Hello, @Ronny Forberger !

    (Edit: Updated with solution)

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Why is my DevOps VM deployment failing with an VMCustomization error?

    Solution provided by Ronny Forberger (thank you!):

    The problem was the vmSizeProperties hash in my bicep code. I didn't know you cannot set it when deploying a specific vmSize. Also I had to set another vmSize, since for Generation 2 hypervisors, the above mentioned SKU seems not to be supported.


    Thank you for helping to improve Microsoft Q&A!

    User's image


1 additional answer

Sort by: Most helpful
  1. Ronny Forberger 45 Reputation points
    2023-08-21T19:30:19.4766667+00:00

    Ah, sorry, I fixed it.

    I was silly, the problem was the vmSizeProperties hash in my bicep code. I didn't know you cannot set it when deploying a specific vmSize.

    Also I had to set another vmSize, since for Generation 2 hypervisors, the above mentioned SKU seems not to be supported.

    Sorry for the effort, but I am still learning Azure and Bicep.

    Thanks again.

    1 person found this answer 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.