Bicep parse error on import

Must-share information (formatted with Markdown):

  • which versions are you using SonarScanner CLI 6.1.0.4477
  • how is SonarQube deployed: Azure DevOps Pipeline
  • what are you trying to achieve Scan a bicep file
  • what have you tried so far to achieve this SonarScanner gives error but runs successful

We have started the use of importing a user defined function. Now the SonarScanner gives an error on the line where whe import that function, like in the following script:

import { resourcePrefix } from '../sharedFunctions.bicep'

@description('The location to deploy the resources in.')
param location string = resourceGroup().location

@description('The prefix to use for all the resources.')
param resourceName string = resourceGroup().name

var prefixName = resourcePrefix(resourceName)

resource nsg 'Microsoft.Network/networkSecurityGroups@2022-11-01' = {
  name: '${prefixName}-nsg'
  location: location
}

This gives the following error:

ERROR Cannot parse 'infrastructure/id.bicep:1:1'

Even though I get an error, the scanner continues and reports a success. Because of this, the pipeline doesn’t stop but continues. The SonarQube site (self hosted) doesn’t show a warning or notification that there was an issue in the latest scan

Hi,

What version of SonarQube are you using? If you’re not sure, check your page footer.

 
Thx,
Ann

Hello Ann,

We are using Developer Edition v10.6 (92116).

Hi,

Thanks for checking. I’ve flagged this for the language team.

 
Ann

Hello Ann,

We have just updated to Developer Edition v10.7 (96327) and there this issue is fixed.

Thank you for looking into this.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.