Az Powershell to get disk encryption is pmk or cmk

MS Techie 2,701 Reputation points
2023-09-19T22:25:50.0666667+00:00

The azure vm disk can be cmk or pmk encrypted. Which azure powershell command let's me find the disk encryption type is pmk or cmk. (Note - i am only bothered about pmk and cmk encryption and not other encryption)

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,874 questions
Azure Disk Encryption
Azure Disk Encryption
An Azure service for virtual machines (VMs) that helps address organizational security and compliance requirements by encrypting the VM boot and data disks with keys and policies that are controlled in Azure Key Vault.
174 questions
0 comments No comments
{count} votes

Accepted answer
  1. TP 94,306 Reputation points
    2023-09-20T00:00:39.29+00:00

    Hi,

    Please see sample code below:

    $disk = Get-AzDisk -ResourceGroupName myResourceGroup -Name myDisk
    $disk.Encryption.Type
    

    azure managed disk encryption type powershell sample

    If Type = EncryptionAtRestWithPlatformKey then it is PMK, if Type = EncryptionAtRestWithCustomerKey it is CMK.

    Please click Accept Answer if the above was useful.

    Thanks.

    -TP

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.