Cannot use Cloud Shell to make VM in PowerShell

DaveMCT 1 Reputation point
2020-08-27T22:43:11.96+00:00

I tried to make an new VM using the cloud shell. I used the actual example # 1 from Microsoft Learn as follows:

New-AzVM -Name MyVm -Credential (Get-Credential)

After entering in a user name and a password I get the following error message:

New-AzVM: The property 'securityProfile.encryptionAtHost' is not valid because the 'Microsoft.Compute/EncryptionAtHost' feature is not enabled for this subscription.  

And then it aborts out.

I can make the exact same VM in the Portal.

This error is new and I've searched for it everywhere, but I get no hits in Bing or Google.

The original docs page is: https://learn.microsoft.com/en-us/powershell/module/az.compute/new-azvm?view=azps-4.6.0

I have used the above command in the past in various demos and classes I've taught without any error. This has only just now appeared.

What can I do to fix, and why am I having it now but not before?

Regards,

Dave Franklyn

Azure Cloud Services
Azure Cloud Services
An Azure platform as a service offer that is used to deploy web and cloud applications.
648 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,201 questions
{count} votes

1 answer

Sort by: Most helpful
  1. prmanhas-MSFT 17,891 Reputation points Microsoft Employee
    2020-08-28T05:07:18.02+00:00

    anonymous userMCT Thank you for your query and apologies for all the inconvenience caused because of the issue.

    I did some research on the issue I found that even though according to this resource the feature is supported only in a limited set of regions others are affected as well. The same behavior can be seen when trying to create a VM in other regions as well (West Europe and North Europe).

    Few potential workaround like this procedure to enable the EncryptionAtHost feature is not applicable to the above-mentioned regions:

    az feature register --namespace "Microsoft.Compute" --name "EncryptionAtHost"
    Once the feature 'EncryptionAtHost' is registered, invoking 'az provider register -n Microsoft.Compute' is required to get the change propagated The feature 'EncryptionAtHost' does not support registration.

    By following a step-by-step approach of VM creation like this one , the creation procedure completes successfully. Tested with both Windows and Ubuntu images.

    I found that some customers are facing the same issue as yours and discussion on same is going on this GitHub thread.You can follow this thread to get the latest information on fix and updates.

    Hope it helps!!!

    Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics

    2 people found this answer helpful.
    0 comments No comments