你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Storage Accounts - List Keys

列出指定存储帐户的访问密钥或 Kerberos 密钥(如果启用了 Active Directory)。

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys?api-version=2025-06-01
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys?api-version=2025-06-01&$expand=kerb

URI 参数

名称 必需 类型 说明
accountName
path True

string

minLength: 3
maxLength: 24
pattern: ^[a-z0-9]+$

指定资源组中的存储帐户的名称。 存储帐户名称长度必须为 3 到 24 个字符,并且只能使用数字和小写字母。

resourceGroupName
path True

string

minLength: 1
maxLength: 90
pattern: ^[-\w\._\(\)]+$

用户订阅中的资源组的名称。 此名称不区分大小写。

subscriptionId
path True

string

minLength: 1

目标订阅的 ID。

api-version
query True

string

minLength: 1

要用于此操作的 API 版本。

$expand
query

ListKeyExpand

指定要列出的键的类型。 可能的值是路缘。

响应

名称 类型 说明
200 OK

StorageAccountListKeysResult

OK -- 成功检索和返回的密钥列表。

安全性

azure_auth

Azure Active Directory OAuth2 流

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

StorageAccountListKeys

示例请求

POST https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res418/providers/Microsoft.Storage/storageAccounts/sto2220/listKeys?api-version=2025-06-01&$expand=kerb

示例响应

{
  "keys": [
    {
      "keyName": "key1",
      "permissions": "Full",
      "value": "<value>"
    },
    {
      "keyName": "key2",
      "permissions": "Full",
      "value": "<value>"
    }
  ]
}

定义

名称 说明
KeyPermission

密钥的权限 -- 只读或完全权限。

ListKeyExpand

指定要列出的键的类型。 可能的值是路缘。

StorageAccountKey

存储帐户的访问密钥。

StorageAccountListKeysResult

ListKeys作的响应。

KeyPermission

密钥的权限 -- 只读或完全权限。

说明
Read
Full

ListKeyExpand

指定要列出的键的类型。 可能的值是路缘。

说明
kerb

StorageAccountKey

存储帐户的访问密钥。

名称 类型 说明
creationTime

string (date-time)

密钥的创建时间,采用往返日期格式。

keyName

string

密钥的名称。

permissions

KeyPermission

密钥的权限 -- 只读或完全权限。

value

string

键的基数 64 编码值。

StorageAccountListKeysResult

ListKeys作的响应。

名称 类型 说明
keys

StorageAccountKey[]

获取指定存储帐户的存储帐户密钥及其属性的列表。