-
Notifications
You must be signed in to change notification settings - Fork 40
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
[FEATURE REQ] Support objects in parameters.json file #296
Comments
@pim-simons, can you share a template that triggers an error message like that? I tried but couldn't reproduce it, this works fine:
|
I believe the issue is when a template doesn't define a default value for the object. The value used during analysis is a mocked object, which will not have the expected properties during template expansion, and fail to parse. |
@pim-simons a possible workaround is to analyze templates individually and specify the parameters file to use with |
I am indeed using a separate parameters json file. @description('Provide the object that contains all info about the common infrastructure.')
param infra object
resource applicationInsight 'microsoft.insights/components@2020-02-02' = {
name: 'test'
location: infra.environment.location
kind: 'other'
} {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"infra": {
"value": {
"environment": {
"location": "West Europe"
}
}
}
}
}
When I use the
@JohnathonMohr thanks for the workaround!! |
@pim-simons, auto-discovery of parameters files is not a high priority for us yet |
No worries, thanks for the heads up! |
I believe I've run into this issue or a similar issue, just want to confirm that I shouldn't open another issue. Github workflow run: Errors on functions.bicep, which has this line:
This particular Bicep file isn't used in this infra, so there are no parameters being specified in a parameters.json. The template-analyzer errors with:
|
Please describe the feature or suggestion.
We are using quite a lot of objects in our parameters.json files to nicely combine several parameters, also described here, for example:
We can then access that value from our Bicep file like this
infra.environment.resourcePrefix
.When running the Template Analyzer tool this does not seem to be supported as I run into these kind of errors:
The template variable 'appSettings' is not valid: The language expression property 'environment' doesn't exist, available properties are 'property1'..
.It seems like using objects in the parameters file are not supported, or am I doing something wrong? Searched within the documentation and issues but couldn't really find anything.
Would be great if this could be supported!
Additional context
Entire error:
The text was updated successfully, but these errors were encountered: