question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
RakeshMohanMSFTcommented, Aug 25, 2022

@witekkij Thank you for reaching out, we are looking into it.

1reaction
witekkijcommented, Aug 29, 2022

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)” \

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apply Azure RBAC to a resource using ARM - Stack Overflow
The key is to drop the scope property, and instead nest the role assignment under the desired resource by using Microsoft.
Read more >
The request to create role assignment ”xxx” is not valid. Role ...
Hi,. If you trying to make a role assignment via ARM template and encountered this error, then please note that this something annoying...
Read more >
The application asked for scope that doesn't exist on the ...
1 Answer ... Hello anonymous user, as the error says the following scopes are not listed in your app registration. So to get...
Read more >
Azure AD spoke throwing error "Client credential flows must ...
Client credential flows must have a scope value with /.default suffixed to the resource identifier (application ID URI). Resolution. Please change the OAuth ......
Read more >
Reference New Or Existing Resource In Azure Bicep - ochzhen
This might be useful to get FQDNs, properties, managed identity info ... Property scope allows specifying where this existing resource lives ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found