Skip to content

Commit 5c6f694

Browse files
author
Kamran Khan
committed
Verify encryptionSettings.enabled for Windows OS enc status
1 parent 046ea25 commit 5c6f694

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ResourceManager/Compute/Commands.Compute/Extension/AzureDiskEncryption/GetAzureDiskEncryptionStatus.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ private EncryptionStatus IsOsVolumeEncrypted(VirtualMachine vmParameters)
7070
switch (osType)
7171
{
7272
case OSType.Windows:
73-
if (GetOsVolumeEncryptionSettings(vmParameters) != null)
73+
DiskEncryptionSettings osEncryptionSettings = GetOsVolumeEncryptionSettings(vmParameters);
74+
75+
if (osEncryptionSettings != null && osEncryptionSettings.DiskEncryptionKey != null && osEncryptionSettings.Enabled == true)
7476
{
7577
return EncryptionStatus.Encrypted;
7678
}

0 commit comments

Comments
 (0)