-
Notifications
You must be signed in to change notification settings - Fork 56
Add support for ARM params file and Bicep params file formats #1282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for ARM parameters file format and Bicep parameters file format (.bicepparam) in DSC configurations. It enables users to provide parameters in the ARM template parameters format (with value wrappers) in addition to the existing simple format, and allows direct use of .bicepparam files via the new Bicep parameters extension.
- Introduces
import_parametersfunction to handle multiple parameter input formats (ARM format, simple format, and JSON-wrapped format) - Adds Bicep parameters extension (
bicepparams.dsc.extension.json) to transform.bicepparamfiles using thebicep build-paramscommand - Refactors parameter file reading logic by consolidating duplicate code into the existing
get_inpututility function
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/dsc-lib/src/configure/parameters.rs | Adds import_parameters function to parse ARM-format parameters and new structs for parameter input handling |
| lib/dsc-lib/src/configure/mod.rs | Integrates import_parameters function to replace direct deserialization |
| lib/dsc-lib/src/extensions/extension_manifest.rs | Adds import_parameters field to extension manifest for future ImportParameters capability |
| lib/dsc-lib/src/extensions/dscextension.rs | Adds ImportParameters capability enum variant |
| lib/dsc-lib/src/extensions/import.rs | Removes redundant debug log before error return, fixes trailing whitespace |
| lib/dsc-lib/src/extensions/mod.rs | Reorders module declarations alphabetically |
| lib/dsc-lib/locales/en-us.toml | Adds localized strings for parameter import operations |
| extensions/bicep/bicepparams.dsc.extension.json | New extension manifest for .bicepparam file format support |
| extensions/bicep/.project.data.json | Updates to include new bicepparams extension manifest in build |
| extensions/bicep/bicep.tests.ps1 | Adds test for bicep parameters file workflow |
| dsc/src/main.rs | Refactors to use centralized get_input function for parameter file reading |
| dsc/locales/en-us.toml | Removes duplicate localized strings now handled by util module |
| dsc/tests/dsc_parameters.tests.ps1 | Adds test for ARM parameters syntax support, updates error message assertion, fixes whitespace |
| dsc/examples/hello_world.dsc.bicep | Adds parameter to enable parameterization |
| dsc/examples/hello_world.dsc.bicepparam | New example demonstrating Bicep parameters file format |
| dsc/examples/hello_world.dsc.json | New example demonstrating ARM parameters file format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Tess Gauthier <[email protected]>
|
@tgauth can you take another look, made a fundamental change with how to handle |
PR Summary
Add import extension to support
.bicepparamfile formatAllow parameters to be in simple or ARM parameters format, however,
referencesupport is not added at this time, onlyvalueis allowed.Because the
.bicepparamresults in a wrapped object, instead of adding direct support of it, I added a newoutputproperty to theimportextension manifest that takes an expression to allow simple transformation which is used in the newbicecpparameterextension to get the internal object string.Added new
stdout()function that can only be used currently withoutputproperty expression which just returns the stdout of the executed command.Fixed an issue where
importcapability wasn't being displayed correct viadsc extension list.Added a bunch of new parser tracing to help diagnose issues.
Consolidated reading input files for params and config into one helper function. This also takes care of reading from STDIN. This also uses any
importextension.Supports 3 parameters formats:
{ "parameters": { "name": "value" } }{ "parameters": { "name": { "value": "paramValue" } }Added helper function to take care of all of these formats
Added new
Microsoft.DSC.Extension/BicepParametersimport extension supporting.bicepparamfile extensionPR Context
Fix #1047
Fix #867