https://pulumi.com logo
#azure
Title
# azure
w

worried-dress-4788

09/11/2023, 2:24 PM
Is there a way to enable features on a whole subscription with Azure native? I’d like to enable EncryptionAtHost for my virtual machine (see https://learn.microsoft.com/en-us/azure/virtual-machines/linux/disks-enable-host-based-encryption-cli ) but I haven’t found the correct ressource for this 🤔
b

bumpy-glass-30283

09/11/2023, 2:44 PM
not sure what you mean, this is enabled per host / per resource. if you want to make it mandatory, then policies are your friends I guess
usually the
az modulename
commands correspond to the pulumi module's name
w

worried-dress-4788

09/11/2023, 3:11 PM
What I’m missing is the “Prerequisites” part (https://learn.microsoft.com/en-us/azure/virtual-machines/linux/disks-enable-host-based-encryption-cli#prerequisites) as I get this error while trying to create a VirtualMachine with Pulumi :
The property 'securityProfile.encryptionAtHost' is not valid because the 'Microsoft.Compute/EncryptionAtHost' feature is not enabled for this subscription.
And I already tried the resource you linked and got this error :
cannot create already existing subresource '/subscriptions/****/providers/Microsoft.Features/featureProviders/Microsoft.Compute/subscriptionFeatureRegistrations/EncryptionAtHost'
I found an Issue matching my problem : https://github.com/pulumi/pulumi-azure-native/issues/1722 I managed to go forward with an Import and then apply a change of the ressource’s state to enable it!