Giter VIP home page Giter VIP logo

Comments (8)

BernieWhite avatar BernieWhite commented on June 1, 2024 1

@AlexanderSehr Thanks for reporting this. I can see the issue. Thanks for the reproduction.

from psrule.

BernieWhite avatar BernieWhite commented on June 1, 2024 1

@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.

AlexanderSehr avatar AlexanderSehr commented on June 1, 2024 1

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.

BernieWhite avatar BernieWhite commented on June 1, 2024 1

@AlexanderSehr Additional fixes in v1.31.3.

from psrule.

github-actions avatar github-actions commented on June 1, 2024

Thanks for raising your first issue, the team appreciates the time you have taken 😉

from psrule.

AlexanderSehr avatar AlexanderSehr commented on June 1, 2024

@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.

AlexanderSehr avatar AlexanderSehr commented on June 1, 2024

cc: @eriqua Updates incoming (:

from psrule.

BernieWhite avatar BernieWhite commented on June 1, 2024

Fixed with PSRule for Azure release v1.31.0.

from psrule.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.