Unable to expand the Parameters in .bicepparam files #3137
-
I have a folder structure like below
My main.bicep looks like this
My param file looks like this
My ps-rule.yaml looks like this
I keep getting the error,
I found 2 alternatives
Am I missing anything here in ps-rule.yaml or Is there any other way we could solve this ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thanks for the question @AhmedValiShaik. Yes, for PSRule to expand the Bicep files it must be able to resolve all parameters, similar to when you deploy to Azure. If the parameters are optionalYour example in (2) is good. However, you may not want these parameters to be optional. If the parameters are requiredYes, you can use Another option is to create a file specifically for testing that is not deployed. It is mainly used for testing modules in isolation. For example, if you wanted to test For testing a deployment with parameter files, the (1) and (2) are both good options for doing this. |
Beta Was this translation helpful? Give feedback.
Thanks for the question @AhmedValiShaik. Yes, for PSRule to expand the Bicep files it must be able to resolve all parameters, similar to when you deploy to Azure.
If the parameters are optional
Your example in (2) is good. However, you may not want these parameters to be optional.
If the parameters are required
Yes, you can use
AZURE_PARAMETER_DEFAULTS
to set the default value for any required parameters that are not set. This option is good for scenarios that would normally be automatically set by the pipeline or CLI.Another option is to create a file specifically for testing that is not deployed. It is mainly used for testing modules in isolation. For example, if you wanted to test
sto…