Linter rule - prefer interpolation
This rule finds uses of the concat function that can be replaced by string interpolation.
Linter rule code
Use the following value in the Bicep configuration file to customize rule settings:
prefer-interpolation
Solution
Use string interpolation instead of the concat
function.
The following example fails this test because the concat
function is used.
param suffix string = '001'
var vnetName = concat('vnet-', suffix)
You can fix it by replacing concat
with string interpolation. The following example passes this test.
param suffix string = '001'
var vnetName = 'vnet-${suffix}'
Optionally, you can use Quickfix to replace the concat
with string interpolation:
Next steps
For more information about the linter, see Use Bicep linter.
Athugasemdir
https://aka.ms/ContentUserFeedback.
Væntanlegt: Á árinu 2024 munum við hætta með GitHub-mál sem ábendingaleið fyrir efni og skipta því út fyrir nýtt ábendingakerfi. Frekari upplýsingar er að finna hér:Senda inn og skoða endurgjöf fyrir