Get-AzStorageAccountKey   
	获取 Azure 存储帐户的访问密钥。
语法
Default (默认值)
Get-AzStorageAccountKey
    [-ResourceGroupName] <String>
    [-Name] <String>
    [-ListKerbKey]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]
说明
Get-AzStorageAccountKey cmdlet 获取 Azure 存储帐户的访问密钥。
示例
示例 1:获取存储帐户的访问密钥
Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount"
此命令获取指定 Azure 存储帐户的密钥。
示例 2:获取存储帐户的特定访问密钥
This command gets a specific key for a Storage account.
(Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount")| Where-Object {$_.KeyName -eq "key1"}
KeyName Value             Permissions CreationTime
------- -----             ----------- ------------
key1    <KeyValue>        Full
This command gets a specific key value for a Storage account.
(Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount")[0].Value
<KeyValue>
示例 3:列出存储帐户的访问密钥,包括 Kerberos 密钥(如果已启用 Active Directory)
Get-AzStorageAccountKey -ResourceGroupName "RG01" -Name "mystorageaccount" -ListKerbKey
此命令获取指定 Azure 存储帐户的密钥。
参数
-DefaultProfile 
		用于与 Azure 通信的凭据、帐户、租户和订阅。
参数属性
| 类型: | IAzureContextContainer | 
| 默认值: | None | 
| 支持通配符: | False | 
| 不显示: | False | 
| 别名: | AzContext, AzureRmContext, AzureCredential | 
参数集
(All)
| Position: | Named | 
| 必需: | False | 
| 来自管道的值: | False | 
| 来自管道的值(按属性名称): | False | 
| 来自剩余参数的值: | False | 
-ListKerbKey  
		列出指定存储帐户的 Kerberos 密钥(如果已启用 Active Directory)。 使用 Microsoft Entra 域服务(Microsoft Entra 域服务)或 Active Directory 域服务(AD DS)为每个存储帐户生成 Kerberos 密钥, 用于基于 Azure 文件标识的身份验证。 它用作表示存储帐户的域服务中注册的标识的密码。 Kerberos 密钥不提供对存储帐户执行任何控制或数据平面读取或写入作的访问权限。
参数属性
| 类型: | SwitchParameter | 
| 默认值: | None | 
| 支持通配符: | False | 
| 不显示: | False | 
参数集
(All)
| Position: | Named | 
| 必需: | False | 
| 来自管道的值: | False | 
| 来自管道的值(按属性名称): | False | 
| 来自剩余参数的值: | False | 
-Name
指定此 cmdlet 为其获取密钥的存储帐户的名称。
参数属性
| 类型: | String | 
| 默认值: | None | 
| 支持通配符: | False | 
| 不显示: | False | 
| 别名: | 存储账户名称, 账户名称 | 
参数集
(All)
| Position: | 1 | 
| 必需: | True | 
| 来自管道的值: | False | 
| 来自管道的值(按属性名称): | True | 
| 来自剩余参数的值: | False | 
-ResourceGroupName  
		指定包含存储帐户的资源组的名称。
参数属性
| 类型: | String | 
| 默认值: | None | 
| 支持通配符: | False | 
| 不显示: | False | 
参数集
(All)
| Position: | 0 | 
| 必需: | True | 
| 来自管道的值: | False | 
| 来自管道的值(按属性名称): | True | 
| 来自剩余参数的值: | False | 
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。