Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading error when providing scope on a resource #5929

Closed
afscrome opened this issue Feb 10, 2022 · 1 comment
Closed

Misleading error when providing scope on a resource #5929

afscrome opened this issue Feb 10, 2022 · 1 comment

Comments

@afscrome
Copy link
Contributor

Bicep version
Vs Code 0.4.1124

Describe the bug
Specifying the scope property on a resourceGroup resource gives the following error

The property "scope" is not allowed on objects of type "Microsoft.Resources/resourceGroups". Permissible properties include "dependsOn", "location", "managedBy", "name", "properties", "tags". If this is an inaccuracy in the documentation, please report it to the Bicep Team.

This error is a bit misleading as the scope property is allowed on Microsoft.Resources/resourceGroups if using an existing reference. A more specific error should be given - something along the lines of

Scope is only allowed for resources of type Microsoft.Resources/resourceGroups when using an existing reference.

To Reproduce

resource foo 'Microsoft.Resources/resourceGroups@2021-04-01' = {
    scope: subscription()
}
@anthony-c-martin
Copy link
Member

Closing as I think this one has since been addressed. I get the following error:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants