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

Improve error message when bicep array syntax is wrong #4991

Closed
fgheysels opened this issue Oct 26, 2021 · 1 comment
Closed

Improve error message when bicep array syntax is wrong #4991

fgheysels opened this issue Oct 26, 2021 · 1 comment
Labels
enhancement New feature or request Needs: Triage 🔍

Comments

@fgheysels
Copy link

I just tried to deploy an Azure resource (keyvault access policy) using bicep. As a new user of bicep, I used the wrong array-syntax to declare the allowed permissions to the KeyVault in my bicep template.
Instead of specifying the array on multiple lines as stated in the documentation, I used comma's to separate the elements, like this:

permissions:
  secrets: ['list', 'get']

Instead of the correct syntax:

permissions:
  secrets: [
     'list' 
     'get'
  ]

My mistake offcourse, but it took me a while before I found the issue, as the error that was given during deployment was this:

Error BCP018: Expected the "}" character at this location.

It would be nice to have a more descriptive error in case somebody declares an array the wrong way in bicep.

@fgheysels fgheysels added the enhancement New feature or request label Oct 26, 2021
@ghost ghost added the Needs: Triage 🔍 label Oct 26, 2021
@alex-frankel
Copy link
Collaborator

Coincidentally, we just merged a fix to resolve this issue with #4956 and it should be available in the next release. Going to close this for now.

@ghost ghost locked as resolved and limited conversation to collaborators May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request Needs: Triage 🔍
Projects
None yet
Development

No branches or pull requests

2 participants