Not able to generate parameter file - Biceps

Varma 1,620 Reputation points
2026-05-15T06:23:44.74+00:00

I am following below steps:

  1. Right click on below code: and clicked on generate parameter file User's image and when i selected JSON and required all then i am seeing following error ;

User's image

you can see the error on down bottom right side.

but file is there right you can see below

User's image

Please suggest

Azure Automation
Azure Automation

An Azure service that is used to automate, configure, and install updates across hybrid environments.


Answer accepted by question author

Siva shunmugam Nadessin 10,895 Reputation points Microsoft External Staff Moderator
2026-05-15T10:55:09.52+00:00

Hello Varma,

Thank you for reaching out to the Microsoft Q&A forum.  

When investigating it looks like VS Code is successfully compiling your Bicep file (you’re seeing main.json show up), but it never actually creates the main.parameters.json that the extension then tries to open. That’s why you get:

“Unable to resolve nonexistent file ‘i:\Bicep\BicepUdemy\main.parameters.json’ followed by:

“Please select the output format and which parameters to include”

Here’s how to fix it:

Use the Bicep CLI directly • Open a terminal in your project folder

• Run:

az bicep generate-params \
  --file main.bicep \
  --include-params all \
  --outfile main.parameters.json

This will create

`main.parameters.json` 

in the same folder. 

You can swap all for RequiredOnly if you only want required parameters. 

Or from VS Code’s command palette

• Open main.bicep

• Press Ctrl+Shift+P, type Bicep: Generate parameters file

• When prompted, pick JSON and All (or RequiredOnly)

• The extension will drop main.parameters.json next to your .bicep file

Verify versions

• Bicep CLI ≥ 0.18.4

• Azure CLI ≥ 2.47.0

• VS Code Bicep extension up to date

After that you should see main.parameters.json in your Explorer, and the errors will go away. From there you can deploy with:

az deployment group create --template-file main.bicep --parameters main.parameters.json

Let me know if any further queries - feel free to reach out!

Reference list:

• Bicep CLI “generate-params” command https://learn.microsoft.com/cli/azure/bicep?view=azure-cli-latest#generate-params

• Create a parameters file for Bicep deployments https://learn.microsoft.com/azure/azure-resource-manager/bicep/parameter-files?wt.mc_id=knowledgesearch_inproduct_azure-cxp-community-insider#generate-parameters-file

• Deploy Bicep with a parameters file (CLI example) https://learn.microsoft.com/azure/azure-resource-manager/bicep/parameter-files?wt.mc_id=knowledgesearch_inproduct_azure-cxp-community-insider#deploy-bicep-file-with-parameters-file

 

Was this answer helpful?

1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. AI answer

    2026-05-15T06:24:07.0266667+00:00

    The Visual Studio Code Bicep extension’s Generate Parameters File command creates the parameters file in the same folder as the Bicep file and then tries to open it. In this scenario the generation succeeds (as shown in the Output window: “Generating parameters file succeeded”), but the extension can’t open main.parameters.json, so it shows the error.

    To generate and use a parameters file reliably, use one of these supported paths:

    1. Use the VS Code Generate Parameters File command correctly
      • Ensure the Bicep file is saved and located in a normal local path (no missing or moved folder).
      • Right‑click the .bicep file → Generate Parameters File.
      • Choose JSON or Bicep parameters file and which parameters to include.
      • The extension will create:
        • main.bicepparam for a Bicep parameters file, or
        • main.parameters.json for a JSON parameters file, in the same folder as main.bicep.
      • If the file is created but not opened, open it manually from the Explorer; the error does not affect the generated file itself.
    2. Generate the parameters file with Azure CLI (recommended when the VS Code UI misbehaves)
      • Run in a terminal from the folder containing main.bicep:
             az bicep generate-params --file main.bicep --output-format json --include-params all
        
      • This creates main.parameters.json in the same directory by default. Use --outdir or --outfile if a different location or name is required.
    3. Alternative: create a Bicep parameters file
      • In VS Code, use Generate Parameters File and choose Bicep parameters file.
      • This creates main.bicepparam:
             using './main.bicep'
             
             param storagePrefix = ''
             param storageAccountType = ''
        
      • Deploy with Azure CLI:
             az deployment group create \
               --name ExampleDeployment \
               --resource-group ExampleGroup \
               --parameters main.bicepparam
        
    4. If the error persists
      • Confirm there is no existing main.parameters.json locked or in a different encoding.
      • Delete any stale main.parameters.json and re‑run the generation.
      • If needed, fall back to the CLI method above, which bypasses the VS Code UI.

    Once the parameters file exists, it can be used in deployments as shown in the documentation (either as a .bicepparam file or as a JSON parameters file).


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.