i am doing this module - Exercise - Set up a DSC and configure a desired state but error is coming while creating a vm

Shalini Sirothiya 1 Reputation point
2022-02-18T15:22:55.34+00:00

$ PASSWORD=$(openssl rand -base64 32)
sirothiyashalini@Azure:~$ az vm create \

--resource-group learn-df90a5df-3520-422f-b7ae-eb2b371c2d78 \
--name myVM \
--image win2019datacenter \
--admin-username $USERNAME \
--admin-password $PASSWORD

It is recommended to use parameter "--public-ip-sku Standard" to create new VM with Standard public IP. Please note that the default public IP used for VM creation will be changed from Basic to Standard in the future.
{"status":"Failed","error":{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Pleasesee https://aka.ms/DeployOperations for usage details.","details":[{"code":"BadRequest","message":"{\r\n \"error\": {\r\n \"code\": \"BadRequest\",\r\n \"message\": \"'VMCustomization' is not enabled for the Subscription. Please register the Subscription for 'Microsoft.Compute/VMCustomizationPreview' to use the feature.\"\r\n }\r\n}"}]}}

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

2 answers

Sort by: Most helpful
  1. Andreas Baumgarten 109.1K Reputation points MVP
    2022-02-18T17:54:13.31+00:00

    Hi @Shalini Sirothiya ,

    maybe this helps: https://learn.microsoft.com/en-us/answers/questions/727655/39vmcustomization39-is-not-enabled-for-the-subscri.html

    It looks like the issue is related to the version on AZ CLI.

    A fix should be on the way: https://github.com/actions/virtual-environments/issues/5099

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    1 person found this answer helpful.
    0 comments No comments

  2. Prrudram-MSFT 24,546 Reputation points
    2022-02-21T09:59:07.157+00:00

    Hello @Shalini Sirothiya ,

    As suggetsed by Andreas above this has been identified as an issue with Azure CLI with the release of 2.33.0.
    From service side, our team will force the deployment and will be completed this week. In the meantime you can update az-cli in runtime

    curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
    echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
    sudo apt-get update
    sudo apt-get install azure-cli
    az version

    You can use the Azure CLI locally on your computer if you need to, however:
    https://learn.microsoft.com/en-us/cli/azure/install-azure-cli

    Please "Accept as Answer" and Upvote if any of the below answerd helped to help others in the community looking for remediation for similar issues.

    0 comments No comments

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.