-
Notifications
You must be signed in to change notification settings - Fork 3.4k
azure scheduled query rules ARM template #31615
Copy link
Copy link
Open
Labels
Auto-AssignAuto assign by botAuto assign by botAzure Deploymentsaz deployment/bicep/stack/deployment-scripts/ts/group exportaz deployment/bicep/stack/deployment-scripts/ts/group exportService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.act-codegen-extensibility-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-triageThis is a new issue that needs to be triaged to the appropriate team.This is a new issue that needs to be triaged to the appropriate team.
Metadata
Metadata
Assignees
Labels
Auto-AssignAuto assign by botAuto assign by botAzure Deploymentsaz deployment/bicep/stack/deployment-scripts/ts/group exportaz deployment/bicep/stack/deployment-scripts/ts/group exportService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.act-codegen-extensibility-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-triageThis is a new issue that needs to be triaged to the appropriate team.This is a new issue that needs to be triaged to the appropriate team.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Type of issue
Typo
Reference command name
az deployment group create --name XXX --resource-group XXX --template-file XXX.json --parameters XXX.json --mode Incremental --output jsonOverview
This issue is similar to #27138.
When using
operator: Equalsas specified in the Microsoft ARM documentation, the request fails with the error:Requested value 'Equals' was not found.Feedback
Upon investigation, it appears that the correct value should be
Equal, as confirmed by inspecting the actual network request on the portal. This discrepancy between the documentation and expected value leads to confusion and failed deployments.{ "properties": { "criteria": { "allOf": [ { "query": "AzureActivity | where TimeGenerated > ago(1h) | where OperationNameValue contains \"Microsoft.ContainerService/managedClusters/agentpools/write\" | where ActivityStatusValue == \"Started\"", "timeAggregation": "Count", "dimensions": [], "resourceIdColumn": "", "operator": "Equal", "threshold": 1, "failingPeriods": { "numberOfEvaluationPeriods": 1, "minFailingPeriodsToAlert": 1 } } ] } } }After digging into the CLI extension where operator conversion is performed, it seems like the correct operator to be using is
Equalinstead ofEquals.https://github.com/Azure/azure-cli-extensions/blob/main/src/scheduled-query/azext_scheduled_query/grammar/scheduled_query/ScheduleQueryConditionValidator.py
I have attempted to change the operator to
Equalinside the ARM template, and the deployment is able to go through successfully. I have yet to test both terraform and bicep template, but it might be worth updating the mentioned attribute in both documentation as well.Page URL
https://learn.microsoft.com/en-us/azure/templates/microsoft.insights/2022-06-15/scheduledqueryrules?pivots=deployment-language-arm-template
Content source URL
No response
Author
No response
Document Id
No response