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

Building bicep parameterfiles with compile-time imported UDFs, exception is thrown #12911

Closed
peter-de-wit opened this issue Jan 4, 2024 · 1 comment · Fixed by #13459
Closed

Comments

@peter-de-wit
Copy link

Bicep version
Bicep CLI version 0.24.24 (5646341)

Describe the bug
When building a bicep parameter file that is referring a compile-time imported UDF, the following compilation error is thrown:
Failed to evaluate parameter "paramname": The template function '_1.getValue' is not expected at this location.

To Reproduce
I've included a project as attachment to reproduce the situation.

build.ps1 --> main.bicepparam.bicep --> throws the error

Additional context
See attachment:
bicep-udt-compiletimeimport-bicepparam-notexpected.zip

@jeskew
Copy link
Contributor

jeskew commented Jan 24, 2024

UDFs aren't supported in bicepparam files at the moment. While the compiler blocks function and type imports via the cherry-pick syntax (import { aType, aFunction } from 'mod.bicep'), there's no similar block when using wildcard imports.

We could add a linter to check the use of wildcard import properties and raise a diagnostic when a function is dereferenced. This would at least provide an opportunity to surface a more helpful error message than the Failed to evaluate... message currently being encountered. This could also be addressed by adding support for UDFs in the bicepparam compiler.

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

Successfully merging a pull request may close this issue.

3 participants