如何旋转Azure日志分析工作区的键

时间:2020-01-17 09:39:06

标签: azure azure-log-analytics

为Azure Log Analytics Workspace以编程方式旋转键的推荐方式是什么?

我发现的唯一描述的方法是通过REST API。但是它似乎不起作用:

curl -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d "" https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/resourcegroups/${RESOURCE_GROUP_NAME}/providers/Microsoft.OperationalInsights/workspaces/${LAW_NAME}/listKeys?api-version=2015-03-20
curl -X POST -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" -d "" https://management.azure.com/subscriptions/${SUBSCRIPTION_ID}/resourcegroups/${RESOURCE_GROUP_NAME}/providers/Microsoft.OperationalInsights/workspaces/${LAW_NAME}/regenerateSharedKey?api-version=2015-03-20

第一个呼叫列表键可以正常工作。第二个尝试旋转键,失败并显示错误消息:

{
  "message": "No HTTP resource was found that matches the request URI 'https://opinsightsweuams.trafficmanager.net/api/subscriptions/XXXXX/resourcegroups/XXXXX/providers/Microsoft.OperationalInsights/workspaces/XXXXX/regenerateSharedKey?api-version=2015-03-20&contextId=XXXXX'."
}

此API是否仍然有效?还有其他旋转键的方法吗?

0 个答案:

没有答案