Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Nov 21, 2025

PR Summary

Add import extension to support .bicepparam file format
Allow parameters to be in simple or ARM parameters format, however, reference support is not added at this time, only value is allowed.
Because the .bicepparam results in a wrapped object, instead of adding direct support of it, I added a new output property to the import extension manifest that takes an expression to allow simple transformation which is used in the new bicecpparameter extension to get the internal object string.

Added new stdout() function that can only be used currently with output property expression which just returns the stdout of the executed command.

Fixed an issue where import capability wasn't being displayed correct via dsc 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 import extension.
Supports 3 parameters formats:

  • current simplified format:
{
  "parameters": {
    "name": "value"
  }
}
  • ARM format:
{
  "parameters": {
    "name": {
      "value": "paramValue"
    }
}

Added helper function to take care of all of these formats
Added new Microsoft.DSC.Extension/BicepParameters import extension supporting .bicepparam file extension

PR Context

Fix #1047
Fix #867

Copy link
Contributor

Copilot AI left a 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_parameters function to handle multiple parameter input formats (ARM format, simple format, and JSON-wrapped format)
  • Adds Bicep parameters extension (bicepparams.dsc.extension.json) to transform .bicepparam files using the bicep build-params command
  • Refactors parameter file reading logic by consolidating duplicate code into the existing get_input utility 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.

@SteveL-MSFT
Copy link
Member Author

@tgauth can you take another look, made a fundamental change with how to handle bicepparam format. I didn't like how the engine hard hardcoded knowledge about it when it's just an object wrapper around the ARM param object so created a new output property with a new stdout() function to extract it

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support .bicepparam file DSC should follow the parameters file schema from Azure

3 participants