microsoft / security-devops-azdevops

Microsoft Security DevOps extension for Azure DevOps.
MIT License
60 stars 16 forks source link

ConfigurationPathNotFoundException: A configuration file could not be found for: template-analyzer #41

Closed leandromsft closed 1 year ago

leandromsft commented 1 year ago

Hello,

I'm configuring the task to run template-analyzer tool

- task: MicrosoftSecurityDevOps@1
      displayName: 'Microsoft Security DevOps'
      inputs:
        config: '$(Build.SourcesDirectory)/.gdn/.gdnsettings'
        tools: 'template-analyzer'

I created the gdnsettings using this example https://github.com/microsoft/security-devops-azdevops/wiki#templateanalyzer-options

But when I execute the pipeline result this error

[error]ConfigurationPathNotFoundException: A configuration file could not be found for: template-analyzer

[error]MSDO CLI exited with an error exit code: 1

Can you please help me with this error?

Thank You

chrisnielsen-MS commented 1 year ago

Hi @leandromsft , what is the content of your .gdnsettings file and is it checked into your repository under the given path ([repo_root]/.gdn/.gdnsettings)?

leandromsft commented 1 year ago

Hi @chrisnielsen-MS

The content of .gdnsettings is based in this doc https://github.com/microsoft/security-devops-azdevops/wiki#templateanalyzer-options

The file .gdnsettings is stored in my git repo in the correct path

chrisnielsen-MS commented 1 year ago

Thank you @leandromsft

I notice your error message has "template-analyzer" with a hyphen, but I don't see it referred to that way in the samples or in our codebase. Are you using "template-analyzer" for the tool name inside your .gdnsettings file? If so, try removing the hyphen and using "templateanalyzer" instead.

leandromsft commented 1 year ago

Thank You @chrisnielsen-MS for help! You're right I change the tool name to templateanalyzer and everthing works fine!

- task: MicrosoftSecurityDevOps@1
      displayName: 'Microsoft Security DevOps'
      inputs:
        tools: 'templateanalyzer'