You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
implement "base" parameters support for extended bicepparam files (#17850)
## Description
Fixes#14522 and #17053
This PR implements the `base` keyword to enable seamless parameter
merging and inheritance in Bicep parameter files. When extending
parameter files, users can now reference parent parameter values using
`base.<paramName>` to create complex merging scenarios without losing
the ability to override specific values.
## Example Usage
```bicep
// parent.bicepparam
param tags = {
environment: 'dev'
team: 'platform'
}
param foo = 'foo'
// child.bicepparam
extends 'parent.bicepparam'
param tags = {
...base.tags // Inherit parent tags
environment: 'prod' // Override specific values
region: 'westus2' // Add new values
}
param bar = base.foo
```
## Checklist
- [x] I have read and adhere to the [contribution
guide](https://github.com/Azure/bicep/blob/main/CONTRIBUTING.md).
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/17850)
$"The identifier '{LanguageConstants.BaseIdentifier}' is only available in parameter files that declare an '{LanguageConstants.ExtendsKeyword}' clause.");
thrownewNotImplementedException($"Encountered an unexpected symbol kind '{symbol?.Kind}' and type '{symbol?.GetType().Name}' when generating a variable access expression.");
this.diagnosticWriter.Write(access.Name, x =>x.BaseIdentifierNotAvailableWithoutExtends());
111
+
}
112
+
}
113
+
else
114
+
{
115
+
foreach(vardeclinsymbol.Declarations.Where(d =>string.Equals(d.Name,LanguageConstants.BaseIdentifier,LanguageConstants.IdentifierComparison)&&dis not BaseParametersSymbol))
116
+
{
117
+
this.diagnosticWriter.Write(decl.DeclaringSyntax, x =>x.BaseIdentifierRedeclared());
0 commit comments