Azure / Azure/azure-rest-api-specs
Microsoft.Insights/scheduledQueryRules does not allow PT1M frequency
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
The API will not allow you to update an existing query rule with the evaluationFrequency set to 'PT1M'. When I run the payload below I receive the error "Couldn't optimize this query so the selected frequency was not supported. Try selecting a different frequency". If I leave off the evaluationFrequency it will still fail if the frequency is set to PT1M in the existing rule. This behavior is present in the 2021-02-01-preview and 2021-08-01 versions. I can create the with evaluationFrequency set to 'PT1M' through the portal and via ARM. It is only in the API where it fails.
```
{
"properties": {
"criteria": {
"allOf": [
{
"query": "My query",
"timeAggregation": "Count",
"resourceIdColumn": "null",
"operator": "GreaterThan",
"threshold": 2,
"failingPeriods": {
"numberOfEvaluationPeriods": 1,
"minFailingPeriodsToAlert": 1
},
"dimensions": [
{
"name": "Subject",
"operator": "Include",
"values": [
"*"
]
}
]
}
]
},
"skipQueryValidation": true,
"windowSize": "PT1M",
"evaluationFrequency": "PT1M"
}
}
```
Contributor guide
Research direction
No file or test is named. Start by reproducing the update against the 2021-02-01-preview and 2021-08-01 API versions with the provided payload, then inspect the Microsoft.Insights/scheduledQueryRules specification entries. Done means an existing rule with PT1M evaluationFrequency can be updated through the API without the unsupported-frequency error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100