skip to Main Content

I use "az monitor scheduled-query" to create ALerting on Application Insight on Azure but it show me error message "ERROR: (BadRequest) Scope can not be updated"
. Please help me to fix this bug

enter image description here

2

Answers


  1. I have run the command to create the alert rule in Application Insights for Azure VM with the below command:

    az monitor scheduled-query create -g "HariTestRG" -n "testkvm01" --scopes "/subscriptions/<subs-id>/resourceGroups/<RGName>/providers/Microsoft.Compute/virtualMachines/testkvm01" --condition "count 'Placeholder_1' > 360 resource id _ResourceId at least 1 violations out of 5 aggregated points" --condition-query Placeholder_1="union Event, Syslog | where TimeGenerated > ago(1h) | where EventLevelName=='Error' or SeverityLevel=='err'" --description "Test rule"
    

    Here vm_id is the resource id of the virtual machine.

    Result:
    enter image description here

    enter image description here

    In Portal View:
    enter image description here

    References: MSFT Doc of CLI command to create the Scheduled Alert

    Login or Signup to reply.
  2. i got the same error and i got a better view of the error when i went to
    Azure Portal > Resource Group > (see image below)

    1. Activity Log
    2. Create Deployment
    3. Scheduled query rule write (The specific line that failed)
    4. JSON

    view BadRequest error

    The cause of error for me was that an existing alert rule already exists for another Azure Data Factory. so i renamed the Alert Rule names and got it fixed.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search