Azure / Azure/arm-template-whatif

Microsoft.Insights/scheduledQueryRules always shown as Create

Open
#102 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

investigate 🔍
Dominant language
HTML
Stars
102
Forks
21
Avg merge
3h 35m
Merged PRs (30d)
1

Description

Describe the noise

Resource type (i.e. Microsoft.Storage/storageAccounts)
Microsoft.Insights/scheduledQueryRules

apiVersion (i.e. 2019-04-01)
2018-04-16

Client (PowerShell, Azure CLI, or API)
Azure CLI 2.8.0

Relevant ARM Template code (we only need the resource object for the above resourceType and apiVersion, but if it's easier you can include the entire template

{
  "name": "myRule",
  "type": "Microsoft.Insights/scheduledQueryRules",
  "apiVersion": "2018-04-16",
  "location": "northeurope",
  "properties": {
    "enabled": "true",
    "source": {
      "query": "['AzureDiagnostics| where ResourceProvider ==\"MICROSOFT.KEYVAULT\"]",
      "dataSourceId": "<WORKSPACE_ID>",
      "queryType": "ResultCount"
    },
    "schedule": {
      "frequencyInMinutes": "15",
      "timeWindowInMinutes": "60"
    },
    "action": {
      "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction",
      "severity": "1",
      "aznsAction": {
        "actionGroup": "<ACTION_GROUP_ID>"
      },
      "trigger": {
        "thresholdOperator": "GreaterThan",
        "threshold": "1"
      }
    }
  }
}

Expected response (i.e. "I expected no noise since the template has not been modified since the resources were deployed)
No noise after the resource is deployed and the template not changed

Current (noisy) response (either include a screenshot of the what-if output, or copy/paste the text)

+ Microsoft.Insights/scheduledQueryRules/myRule [2018-04-16]
       apiVersion:                                  "2018-04-16"
       id:                                          "<GENERATED_ID>"
       location:                                    "northeurope"
       name:                                        "myRule"
       properties.action.aznsAction.actionGroup:    "<ACTION_GROUP_ID>"
       properties.action.odata.type:                "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction"
       properties.action.severity:                  "1"
       properties.action.trigger.threshold:         "1"
       properties.action.trigger.thresholdOperator: "GreaterThan"
       properties.enabled:                          "true"
       properties.schedule.frequencyInMinutes:      "15"
       properties.schedule.timeWindowInMinutes:     "60"
       properties.source.dataSourceId:              "<WORKSPACE_ID>"
       properties.source.query:                     "AzureDiagnostics| where ResourceProvider =="MICROSOFT.KEYVAULT""
       properties.source.queryType:                 "ResultCount"
       type:                                        "Microsoft.Insights/scheduledQueryRules"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Azure CLI 2.8.0 what-if output for the Microsoft.Insights/scheduledQueryRules resource at API version 2018-04-16 using the ARM resource object shown. No repository file or test is named in the issue, so first locate the comparison and noise-suppression path for this resource type; done means an unchanged deployed template is no longer reported as Create.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.