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

Bicep does not compile scope correctly #13032

Closed
Meertman opened this issue Jan 17, 2024 · 2 comments
Closed

Bicep does not compile scope correctly #13032

Meertman opened this issue Jan 17, 2024 · 2 comments
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@Meertman
Copy link

Meertman commented Jan 17, 2024

Bicep version
0.24.24

Describe the bug
As described in GitHub issue - Scope can not be passed as a parameter to a module #3626 , a scope cannot be passed as a parameter. So in order to be able to extract our role assignments into one template, we started with the following implementation:
RoleAssignment.bicep.json

When compiling this bicep file into ARM, it generates the following ARM: Generated_RoleAssignment.json

Note the absence of the scope property in the role assignment resource.

To Reproduce

  1. Download the file RoleAssignment.bicep.json
  2. Rename the file RoleAssignment.bicep.json to RoleAssignment.bicep
  3. Run the command: az bicep build -f RoleAssignment.bicep

Additional context
I would expect the bicep to generate the following ARM template which is a valid ARM template and allows us to create a central template for role assignment: Expected_RoleAssignment.json

@shenglol
Copy link
Contributor

shenglol commented Feb 6, 2024

Closing and tracking with #2246.

@shenglol shenglol closed this as completed Feb 6, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Bicep Feb 6, 2024
@Meertman
Copy link
Author

Meertman commented Feb 7, 2024

@stephaniezyen, @shenglol, I understand that the proposal described in #2246 is to allow the passing of the resource as a parameter.

While this would solve my initial problem, the current work-around should also work. However, it seems like the current bicep file is not correctly compiled as an ARM file. So it feels a bit wrong to just close this as the passing of the resource will not actually fix the compilation of the current bicep file. (It will however make the current work-around obsolete)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
Archived in project
Development

No branches or pull requests

2 participants