Closed KaiWalter closed 3 years ago
Thanks @KaiWalter for catching this one.
As I wrote on SO, expressions in loops need to be deployment-time constants and we should catch that.
Additional question is - can the runtime itself be altered to allow such operations?
@shenglol - will this be fixed by your current PR?
edit: when I say "fixed", I mean this error should have been caught at authoring-time. To @miqm's point, ideally this is something we could eventually allow in the runtime.
No, that PR solves a different problem. I can send a separate PR to fix this once the current one is merged.
Closing as dup of #2090
Bicep version Bicep CLI version 0.3.126 (a5e4c2e567)
Describe the bug (Stackoverflow reference : https://stackoverflow.com/questions/67255232/the-template-function-reference-is-not-expected-when-feeding-api-management-pr)
I want to create DNS A records for my internal API Management instance in a private DNS zone
azure-api.net
along with the API Management deployment:However when deploying it results into this error:
It seems that
reference()
function is not supported at this place (in ARM):Trying with a variable in between results in the same error - as practically the same ARM JSON is generated.
I found no other way than to split private DNS zone + record creation into a Bicep module and with that getting rid of the
reference()
function:and passing the
privateIPAddresses
array to the module.