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

Existing syntax in language version 2 does not allow defining the same resource twice or more. #173

Open
slavizh opened this issue Sep 19, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@slavizh
Copy link

slavizh commented Sep 19, 2024

Issue is well known and defined here: Azure/bicep#13674
Graph requires defining extension microsoftGraph syntax which automatically makes the language version of the compiled ARM template to version 2 and you make it compile to language version 1. So in the case with Graph resources the only workaround to the issue is to use resoruceId() syntax instead of existing syntax.
Issue is opened due to conversation in #126

@slavizh slavizh added the bug Something isn't working label Sep 19, 2024
@slavizh
Copy link
Author

slavizh commented Oct 1, 2024

@dkershaw10 note that the issue exists only for Azure resources - in this case user assigned identity was defined as existing with two different syntax so it can be put as member and owner of a group. When I define Entra Application/Service principal the same way to put it as member and owner the issue is not present.

@dkershaw10
Copy link
Collaborator

@slavizh please close this if your testing checks out on Azure/bicep#13674

@slavizh
Copy link
Author

slavizh commented Nov 5, 2024

@dkershaw10 yeah. I am planning to test if everything I have logged is fixed and close items that are fixed. Have to wait for the the next bicep release as compiling builds on my own is not my thing. Will get back once I have tested it.

@slavizh
Copy link
Author

slavizh commented Nov 7, 2024

@dkershaw10 Unfortunately the new Bicep CLI not only made the errors worse but also the working code around existing graph resources that I had also stopped working. Getting:

"properties": {
"statusCode": "InternalServerError",
"serviceRequestId": null,
"statusMessage": "{"error":{"code":"MultipleErrorsOccurred","message":"Multiple error occurred: . Please see details.","details":[{"code":"InternalServerError","message":"Encountered internal server error. Diagnostic information: timestamp '20241107T090031Z', subscription id 'f4b90a18-b44d-439b-a1b7-3c7fae8a8d54', tracking id '615361af-d1e7-4ef7-b7af-1c54f181f58b', request correlation id '615361af-d1e7-4ef7-b7af-1c54f181f58b'."},{"code":"InternalServerError","message":"Encountered internal server error. Diagnostic information: timestamp '20241107T090031Z', subscription id 'f4b90a18-b44d-439b-a1b7-3c7fae8a8d54', tracking id '615361af-d1e7-4ef7-b7af-1c54f181f58b', request correlation id '615361af-d1e7-4ef7-b7af-1c54f181f58b'."},{"code":"InternalServerError","message":"Encountered internal server error. Diagnostic information: timestamp '20241107T090031Z', subscription id 'f4b90a18-b44d-439b-a1b7-3c7fae8a8d54', tracking id '615361af-d1e7-4ef7-b7af-1c54f181f58b', request correlation id '615361af-d1e7-4ef7-b7af-1c54f181f58b'."},{"code":"InternalServerError","message":"Encountered internal server error. Diagnostic information: timestamp '20241107T090031Z', subscription id 'f4b90a18-b44d-439b-a1b7-3c7fae8a8d54', tracking id '615361af-d1e7-4ef7-b7af-1c54f181f58b', request correlation id '615361af-d1e7-4ef7-b7af-1c54f181f58b'."}]}}",

@slavizh
Copy link
Author

slavizh commented Nov 7, 2024

Created issue Azure/bicep#15513

@dkershaw10
Copy link
Collaborator

Thanks @slavizh. This is disappointing. I've taken this problem up internally with both the BIcep and Graph engineering teams.

@slavizh
Copy link
Author

slavizh commented Nov 7, 2024

@dkershaw10 after more testing seems the issues I have found are related to Graph resources referenced as existing. When not using Graph and extensibility there are improvements and no such issues. Another issue that I have found is Azure/bicep#15515 . But overall the ability to reference the same resource twice is partially fixed. It works if the same resource is referenced in two different existing syntaxes ( the case I was testing with Graph - the same user assigned identity assigned as member and owner to group) but it does not work if the resource is referenced twice or more within the same existing syntax. The latter is Azure Policy and other scenarios that I have not found needed for Graph for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants