Azure / Azure/azure-rest-api-specs

ApplicationInsights Microsoft.Insights/components/apiKeys@2015-05-01 POST returns Internal Server Error

Open
#20,690 0 comments 0 reactions 0 assignees View on GitHub
Insights Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

Seems `linkedReadProperties` and `linkedWriteProperties` cannot both be empty. At least one read or write permission must be defined. But service should not return 500.

https://github.com/Azure/azure-rest-api-specs/blob/e21f2da8dacad060a3612dc8ae0fe6de48b15986/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/componentApiKeys_API.json#L185-L208

API Payload:
```
POST https://management.azure.com/subscriptions/{{subscriptionId}}/resourceGroups/wt-test-ag/providers/Microsoft.Insights/components/tf-test-appinsights/apiKeys?api-version=2015-05-01

{
"name": "test2"
}

OR

{
"name": "test2",
"linkedReadProperties": [],
"linkedWriteProperties": []
}
```

Response:
500 Internal Server Error
```
{
"Message": "An error has occurred."
}
```
x-ms-request-id: 2fd9d670-a73e-442b-888f-de1c78979bd4
x-ms-correlation-request-id: 2fd9d670-a73e-442b-888f-de1c78979bd4

Contributor guide

Open the contributing guide

Research direction

Start with specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/componentApiKeys_API.json, lines 185-208, and compare the schema with the reported POST payloads. Reproduce the request if possible and determine what contract or specification change is expected for empty permissions and the 500 response; completion requires a documented, testable resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, openapi
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.