Azure / Azure/azure-rest-api-specs
QueryPackQuery.Update API cannot update the `Related` property when it isn't set at creation
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 424
Description
While testing, I found [QueryPackQuery.Update](https://github.com/Azure/azure-rest-api-specs/blob/d62bf7ac84940147fc5c0faceaac111b1a8c360d/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/QueryPackQueries.json#L191) API cannot update the `Related` property and throws below error message after the Query Pack Query is created successfully without setting the `Related` property. Seems there is a bug at service side while initiating object. Could you help take a look and fix the issue? Thanks in advance.
Request payload:
```
PATCH https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-LA-test21/providers/Microsoft.OperationalInsights/queryPacks/acctestlaqp-test21/queries/xx-xx-xx-xx?api-version=2019-09-01
{
"properties": {
"id": "xx-xx-xx-xx",
"displayName": "Exceptions - New in the last 24 hours",
"body": "xxxxxxxxxx",
"related": {
"solutions": [
"AlertManagement"
]
}
}
}
```
Error message:
```
{
"error": {
"code": "InternalServerError",
"message": "Object reference not set to an instance of an object.",
"innererror": {
"trace": [
"System.NullReferenceException"
]
}
}
}
```
Contributor guide
Research direction
Start with specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/QueryPackQueries.json and inspect the QueryPackQuery.Update operation against the reported PATCH payload. Determine whether the specification can represent this update or whether the failure is entirely service-side; done means documenting or correcting the applicable specification behavior, if this repository owns it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, openapi
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100