You must enable the feature for your subscription before you can use encryption at host for either your VM or Virtual Machine Scale Set. Use the following steps to enable the feature for your subscription:
Azure portal: Select the Cloud Shell icon on the Azure portal:.
Execute the following command to register the feature for your subscription:
Register-AzProviderFeature -FeatureName "EncryptionAtHost" -ProviderNamespace "Microsoft.Compute"
Confirm that the registration state is Registered (registration may take a few minutes) using the following command before trying out the feature.
Get-AzProviderFeature -FeatureName "EncryptionAtHost" -ProviderNamespace "Microsoft.Compute"
Hopefully this will resolve your issue.
Please click "Accept as answer" if this helps.