ERROR: Scope must be a valid resource id
See original GitHub issue
az feedback
auto-generates most of the information requested below, as of CLI version 2.0.62
Related command az monitor metrics alert create
Describe the bug When trying to create alert for Logic App failure, I am getting ERROR no matter what is actually provided as scopes
To Reproduce use following SHELL script:
ALERT_NAME="Scheduling
$(LOGIC_APP_NAME) failed"
ALERT_DESCRYPTION=“$ALERT_NAME at least 3 times in last 15 minutes”
RESOURCE_ID=az resource show -n '$(LOGIC_APP_NAME)' --resource-group $(RESOURCE_GROUP) --resource-type Microsoft.Logic/workflows --query id
az monitor metrics alert create
–name “$ALERT_NAME”
–description “$ALERT_DESCRYPTION”
–resource-group $(RESOURCE_GROUP)
–scopes $RESOURCE_ID
–condition “total Runs Failed > 2”
–action $(ACTION)
–severity 4
`
Expected behavior
Additional context I am using Azure Resource Manager connection
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
@witekkij Thank you for reaching out, we are looking into it.
Thank you for quick help, most probably its problem with variable. I ended up using following string interpolation –scopes “/subscriptions/$(SUBSCRYPTION_ID)/resourceGroups/$(RESOURCE_GROUP)/providers/Microsoft.Logic/workflows/$(LOGIC_APP_NAME)” \