Skip to content

Improve the error for nested getSecret() calls in parameter files#20066

Open
polatengin wants to merge 8 commits into
mainfrom
polatengin/19934-getsecret-in-bicepparam-fails-with-bcp338-when-used-in-a-nested-property-of-a-structured-parameter
Open

Improve the error for nested getSecret() calls in parameter files#20066
polatengin wants to merge 8 commits into
mainfrom
polatengin/19934-getsecret-in-bicepparam-fails-with-bcp338-when-used-in-a-nested-property-of-a-structured-parameter

Conversation

@polatengin

Copy link
Copy Markdown
Member

Description

Fixes #19934

ARM supports Key Vault references as complete parameter values. It does not support them inside objects or arrays.

This change detects nested getSecret() calls earlier and reports BCP351 error.

Top-level getSecret() assignments and supported extension configuration assignments continue to work.

I've added tests for getSecret() calls;

  • Object properties
  • Arrays of objects
  • Nested objects and arrays
  • Conditional expressions
  • Loop expressions
  • Namespaced az.getSecret() calls
  • Calls that include a secret version

Before the fix, all new tests failed with BCP338, after the fix, they pass and report BCP351 as expected.

The existing parameter-file and extension configuration tests also pass.

Checklist

@github-actions

Copy link
Copy Markdown
Contributor

Test this change out locally with the following install scripts (Action run 29541446351)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 29541446351
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 29541446351"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 29541446351
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 29541446351"

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

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

getSecret() in .bicepparam fails with BCP338 when used in a nested property of a structured parameter

1 participant