name: last(split(resourceId, '/'))! is fixed by removing exclamation mark#3377
name: last(split(resourceId, '/'))! is fixed by removing exclamation mark#3377paggarwalmsft wants to merge 3 commits intoAzure:mainfrom
Conversation
|
|
||
| resource AzureADDS 'Microsoft.AAD/DomainServices@2021-05-01' existing = { | ||
| name: last(split(resourceId, '/'))! | ||
| name: last(split(resourceId, '/')) |
There was a problem hiding this comment.
Hey @paggarwalmsft, could you kindly provide more info on the error you are experiencing? E.g., is it when deploying locally or through pipelines? Which bicep version are you using to deploy?
There was a problem hiding this comment.
Echoing @eriquas comment, this character was added to align with a specific null-checker linter rule (see this PR). That being said, maybe they changed their rules yet again. At least I cannot reproduce the linter warning when removing the ! locally either. I'll try to find out if there is some documented update of the rule set.
Like Erika said, please let us know which Bicep CLI version you're using (bicep -version).
There was a problem hiding this comment.
Bicep CLI version 0.18.4 (1620479ac6)
|
Following a joint investigation, we established that the issue was introduced with a new Linter Rule back in January (ref PR). As the modules were updated in accordance with the new rule, older Bicep versions would not be compatible (which essentially leads to the raised warning). |
Description
name: last(split(resourceId, '/'))! here exclamation mark was causing error "Error BCP236: Expected a new line or comma character at this location."
Pipeline references
Type of Change
Please delete options that are not relevant.
Checklist