Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Fix linter warnings in bicep templates #197

Open
jftl6y opened this issue Nov 17, 2022 · 2 comments
Open

Fix linter warnings in bicep templates #197

jftl6y opened this issue Nov 17, 2022 · 2 comments
Assignees
Labels
bicep Related to Bicep code enhancement New feature or request good first issue Good for newcomers

Comments

@jftl6y
Copy link
Collaborator

jftl6y commented Nov 17, 2022

Several bicep templates are throwing linter warnings during compile. The most common is something like:
The name of variable 'builtInRoleNames_var' appears to have originated from a naming conflict during a decompilation from JSON. Consider renaming it and removing the suffix (using the editor's rename functionality). [https://aka.ms/bicep/linter/decompiler-cleanup]

Other warnings:

  • Flagging potential security warnings for passwords or other secure values which do not include the @secure() attribute on parameters.
  • Warning use-resource-id-functions: If property "policyDefinitionId" represents a resource ID, it must use a symbolic resource reference, be a parameter or start with one of these functions: extensionResourceId, guid, if, reference, resourceId, subscription, subscriptionResourceId, tenantResourceId. Found nonconforming expression at policyDefinitionId -> policyScopedId [https://aka.ms/bicep/linter/use-resource-id-functions]
  • Warning no-hardcoded-location: Parameter 'location' may be used as a resource location in the module and should not be assigned a hard-coded string or variable value. Please use a parameter value, an expression, or the string 'global'. Found: '' [https://aka.ms/bicep/linter/no-hardcoded-location]

Describe the solution you'd like
Address all linter warnings.

@jftl6y jftl6y added enhancement New feature or request good first issue Good for newcomers bicep Related to Bicep code labels Nov 17, 2022
@jrspinella
Copy link
Contributor

Based on what I am doing with the testing fx, I had to fix the linter warnings to validate the modules. Once I merge my changes for this, linter warnings should be gone.

@OutKa5t
Copy link
Contributor

OutKa5t commented Dec 30, 2022

Making this part of the PR process should reduce any further increase in warnings if it becomes an issue.

@jftl6y jftl6y self-assigned this Jan 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bicep Related to Bicep code enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants