首页 > 解决方案 > 如何获取 Azure 存储加密状态

问题描述

我正在尝试从命令行或以编程方式获取 Azure 存储的加密状态,但找不到任何相关的 cmdlet(https://docs.microsoft.com/en-us/powershell/module/azure.storage/get-azurestorageserviceproperty?view= azurermps-6.13.0)。我可以像这样从门户网站手动检查

在此处输入图像描述

是否可以通过任何命令行进行检查,或者我们只能通过门户进行检查?

标签: azureazure-storage

解决方案


你可以使用下面的命令,确保你已经安装了Az模块。

(Get-AzResource -ResourceGroupName <group-name> -ResourceType Microsoft.Storage/storageAccounts -Name <storageaccount-name>).Properties.encryption | ConvertTo-Json

如果Encryption typeMicrosoft-managed keyskeySource将是Microsoft.Storage

在此处输入图像描述

如果Encryption typeis Customer-managed keyskeySourcewill be Microsoft.Keyvaultkeyvaultproperties将包括您配置的 keyvault 密钥的属性。

在此处输入图像描述


推荐阅读