Skip to content
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

Bicep generate-params don't emit optional parameters with --include-params All flag #13558

Closed
olegKoshmeliuk opened this issue Mar 8, 2024 · 0 comments · Fixed by #13559
Closed

Comments

@olegKoshmeliuk
Copy link
Contributor

Bicep version
Bicep CLI version 0.25.53 (c0ad57d)
Describe the bug
Optional parameters are not emitted by command az bicep generate-params with flag--include-params All

To Reproduce
Create main.bicep file

param productName string = 'testproduct'
param envType string
param sqlServerExists bool =false

run command az bicep generate-params -f main.bicep --stdout --include-params All --output-format json
result output does not contain optional parameters

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "envType": {
      "value": ""
    }
  }
}

Additional context
This bug reproduced only for JSON format. bicep format is working fine.
VS Code Generate parameters file command also have this bug

main.bicep.txt

anthony-c-martin pushed a commit that referenced this issue Mar 9, 2024
Closes #13558 Bicep generate-params
don't emit optional parameters with --include-params All flag
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/13559)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant