-
Notifications
You must be signed in to change notification settings - Fork 756
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
Inccorrect existing resource reference when using user defined types feature #9642
Comments
@jeskew This seems fixed in latest bicep version. Not sure which change fixed it but I have tested it. ARM code that is generated now is: "scopes": [
"[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', parameters('azureMonitorWorkspace').subscriptionId, parameters('azureMonitorWorkspace').resourceGroup), 'Microsoft.Monitor/accounts', parameters('azureMonitorWorkspace').name)]"
], |
The |
A similar regression happens with the following pattern. Works just fine when UDTs are disabled, but blows up with "The language expression property 'networkSecurityGroup' doesn't exist" or "The language expression property 'publicIpAddresses' doesn't exist" when enabled.
|
@jeskew most likely can be closed? |
A fix for the underlying issue with |
Bicep version
v0.13.1
Describe the bug
When using the following experimental feature:
When referencing resource in another resource group incorrect resource is being referenced. For example, if I have defined existing resource like this:
and using later monitorWorkspace.id on another property it tries to look for the resource in the resource group where deployment is happening rather in the resource group that is defined in azureMonitorWorkspace.resourceGroup
When looking at the generated ARM template the code is the following:
When you do deployment you can clearly see that what-if reports that scope value will be changed and the only difference is that the resource group name where the resource is located is the one where the deployment is happening not the one defined via input parameters. Same code works fine when experimental feature is not enabled.
To Reproduce
Steps to reproduce the behavior:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: