我正在为 App Insight 生成 API 密钥。我正在使用 URL“ https://management.azure.com/subscriptions/ {subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys”
我没有任何明确的文档,我从 MS SDK 中找到了这个: https ://github.com/Azure/azure-sdk-for-net/blob/master/sdk/applicationinsights/Microsoft.Azure.Management.ApplicationInsights /src/Generated/APIKeysOperations.cs
但是,当我尝试通过提及“名称”来生成时,会出现错误响应:
{
"code": "The API Key needs to have a Role",
"message": "The API Key needs to have a Role",
"innererror": {
"diagnosticcontext": "e1f66da1-9247-459e-a519-6426fa1449d1",
"time": "2019-09-20T07:48:20.2634617Z"
}
}
我的 POST 正文如下:
{
"name": "asimplekeyname"
}
如果有人使用过这个特定的 API,请提供帮助。