Comments (8)
@AlexanderSehr Thanks for reporting this. I can see the issue. Thanks for the reproduction.
from psrule.
@AlexanderSehr stable release is imminent (Azure/PSRule.Rules.Azure#2525). However, you can try it out, from pre-release v1.31.0-B0048.
from psrule.
Hey @BernieWhite any chance we could re-open the issue?
For us on the CARML/AVM-side the issue still persists with the new version. For reference, this was the original error we came across with version 1.29.0
:
Error: Failed to expand bicep source '/home/runner/work/bicep-registry-modules/bicep-registry-modules/avm/res/key-vault/vault/tests/e2e/defaults/main.test.bicep'. Exception calling "GetBicepResources" with "2" argument(s): "Unable to expand resources because the source file '/home/runner/work/bicep-registry-modules/bicep-registry-modules/avm/res/key-vault/vault/tests/e2e/defaults/main.test.bicep' was not valid. An error occurred evaluating expression '[length(coalesce(parameters('accessPolicies'), createArray()))]' line 611. The parameter named 'accessPolicies' was not set or a defaultValue was defined."
and this is the one we come across with version 1.31.0
:
Error: Failed to expand bicep source '/home/runner/work/bicep-registry-modules/bicep-registry-modules/avm/res/key-vault/vault/tests/e2e/defaults/main.test.bicep'. Exception calling "GetBicepResources" with "2" argument(s): "Unable to expand resources because the source file '/home/runner/work/bicep-registry-modules/bicep-registry-modules/avm/res/key-vault/vault/tests/e2e/defaults/main.test.bicep' was not valid. An error occurred evaluating expression '[length(variables('secretList'))]' line 849. An error occurred evaluating expression '[coalesce(tryGet(parameters('secrets'), 'secureList'), createArray())]' line 630. Cannot access child value on Newtonsoft.Json.Linq.JValue."
I'll attribute the different parameter it's complaining about to the fact that the module continued to be worked on since the original run and maybe the parameter order changed.
In either case, the issue that we have a parameter like
@description('Optional. All access policies to create.')
param accessPolicies array?
@description('Optional. All secrets to create.')
@secure()
param secrets object?
that is used in a logic like
var formattedAccessPolicies = [for accessPolicy in (accessPolicies ?? []): { (...) }
var secretList = secrets.?secureList ?? []
For reference, what the logic does in either case is to use the coalesce feature to check if a parameter is null, and if so default to an empty array (I guess the same would be true if it were an object).
from psrule.
@AlexanderSehr Additional fixes in v1.31.3.
from psrule.
Thanks for raising your first issue, the team appreciates the time you have taken 😉
from psrule.
@BernieWhite, with the issues closed, do you already know when the fix would become available? I guess it'll require a release first.
from psrule.
cc: @eriqua Updates incoming (:
from psrule.
Fixed with PSRule for Azure release v1.31.0.
from psrule.
Related Issues (20)
- Cast exception when expanding the union of an array and an AccessPolicyEntry[] HOT 4
- CLI IndexOutOfRangeException with lock file
- Improve support for match to process an array of string
- As 'Summary' option does not work HOT 5
- Add outcome argument for CLI
- Simplify usage of running analysis
- Cannot process argument because the value of argument "name" is not valid HOT 3
- Add commands to list locked modules
- Move restore to module command
- CLI takes a long time to return when a file cant be found
- Include effective configuration in SARIF output
- Include source file hashes in SARIF
- Allow disabling PowerShell features that can be run from a repository
- CLI null reference when include module is undefined
- Investigate Input.IgnoreObjectSource bug
- Tooling shipped with VSCode
- Fail closed support
- CLI discovery of installed modules
- Investigate Rule.Exclude merge improvements
- Fix for git head in tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psrule.