Skip to content

Add context menu option to generate snapshots for .bicepparam files#19024

Open
verschaevesiebe wants to merge 1 commit intoAzure:mainfrom
verschaevesiebe:feature/bicep-snapshot-vsc-ui
Open

Add context menu option to generate snapshots for .bicepparam files#19024
verschaevesiebe wants to merge 1 commit intoAzure:mainfrom
verschaevesiebe:feature/bicep-snapshot-vsc-ui

Conversation

@verschaevesiebe
Copy link
Copy Markdown
Contributor

@verschaevesiebe verschaevesiebe commented Feb 17, 2026

Description

Added a context menu option to generate snapshots for .bicepparam files in VS Code. Users can now right-click a Bicep parameters file and select "Generate Snapshot" to create a .snapshot.json file, making the existing bicep snapshot CLI command accessible directly from the editor.

Fixes #18861 (only UI, pattern needs to be checked with PG if feature is wanted, i would assume the generate button is already sufficient)

generate.snapshot.vsc.ui.mp4

Example Usage

Before: Users had to manually run bicep snapshot <file>.bicepparam from the command line.

After: Users can right-click any .bicepparam file in VS Code and select "Bicep: Generate Snapshot":

Context Menu Locations:

  • Right-click in File Explorer
  • Right-click on editor tab
  • Right-click within editor
  • Command Palette (Ctrl+Shift+P → "Bicep: Generate Snapshot")

Example Output:
Snapshot generation succeeded. Created file c:\path\to\file.snapshot.json
The generated .snapshot.json file will appear alongside the .bicepparam file.

Checklist

Microsoft Reviewers: Open in CodeFlow

@verschaevesiebe
Copy link
Copy Markdown
Contributor Author

The "Generate Snapshot" command currently only uses overwrite mode (creates or updates the .snapshot.json file). The CLI supports two modes:

  • --mode overwrite (default in this PR): Creates or overwrites the snapshot file
  • --mode validate: Checks if an existing snapshot matches what would be generated

I chose overwrite as the default since it's the most straightforward use case for the VS Code UI. If there's a need to also support validate mode (e.g., as a separate command), I'm happy to add that.

Comment on lines +63 to +69
tenantId: null,
subscriptionId: null,
resourceGroup: null,
location: null,
deploymentName: null,
cancellationToken: cancellationToken,
externalInputs: []);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think realistically we'd need a way for someone to supply these inputs, but this would result in a complex UI experience, unless we're able to save the values somewhere.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can build a tree view for selecting scope later. It would be great if both deploy pane and the snapshot command can share the same UI.

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.

Bicep snapshot additional features

4 participants