Azure Rest API到经典存储帐户的ListKeys [英] Azure rest apis to ListKeys of classic storage account

查看:108
本文介绍了Azure Rest API到经典存储帐户的ListKeys的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检索经典存储帐户的访问密钥. 我在网上找到了

I wanted to retrieve the access keys of classic storage account. I found this online

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys?api-version=2016-12-01

但这不适用于经典存储帐户.当我将Microsoft.Storage替换为Microsoft.ClassicStorage时,它将引发以下错误

But this is not applicable for classic storage account. When I replace the Microsoft.Storage to Microsoft.ClassicStorage, it throws the following error

{
    "error": {
        "code": "InvalidRequestUri",
        "message": "The request uri is invalid. The requested path '/subscriptions/{subscriptionID}/resourceGroups/{myresourcegroup}/providers/Microsoft.ClassicStorage/storageAccounts/{myStorageAccount}/listKeys' is not found."
    }
}

注意:我正在使用未委派的应用程序权限.

NOTE: I am using Application permissions not delegated.

推荐答案

对于传统的存储帐户,列出密钥的记录方法是使用服务管理API(不幸的是,我找不到该文档).

For classic storage accounts, the documented way to list keys is using Service Management API (unfortunately I am not able to find the documentation).

您也可以使用ARM API获取传统存储帐户的密钥,但是不支持该密钥,Microsoft随时可能会完全删除该API.为此,只需使用以下URL:

You can get the keys for a classic storage accounts using ARM API as well however it is not supported and Microsoft may remove that API completely anytime. To do so, simply use the following URL:

https://management.azure.com/subscriptions/ {subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ClassicStorage/storageAccounts/{accountName}/listKeys?api-version = 2015-06-01

https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ClassicStorage/storageAccounts/{accountName}/listKeys?api-version=2015-06-01

如果可能,还建议您将经典存储帐户转换为ARM存储帐户.

It is also recommended that you convert your classic storage accounts to ARM storage accounts if possible.

这篇关于Azure Rest API到经典存储帐户的ListKeys的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆