Linter rule - simplify interpolation
This rule finds syntax that uses string interpolation when it isn't needed.
Linter rule code
Use the following value in the Bicep configuration file to customize rule settings:
simplify-interpolation
Solution
Remove any uses of string interpolation that isn't part of an expression to combine values.
The following example fails this test because it just references a parameter.
param AutomationAccountName string
resource AutomationAccount 'Microsoft.Automation/automationAccounts@2022-08-08' = {
name: '${AutomationAccountName}'
...
}
You can fix it by removing the string interpolation syntax.
param AutomationAccountName string
resource AutomationAccount 'Microsoft.Automation/automationAccounts@2022-08-08' = {
name: AutomationAccountName
...
}
Optionally, you can use Quick Fix to remove the string interpolation syntax:
Next steps
For more information about the linter, see Use Bicep linter.
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho