Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TemplateAnalyzer: Error parsing Bicep when a parameter isn't specified #65

Open
pamelafox opened this issue Jul 20, 2023 · 2 comments
Open

Comments

@pamelafox
Copy link
Member

We have a situation where we use azd to deploy Bicep files, and we intentionally leave one of the parameters unspecified, so that azd prompts for that parameter.

However, the template-analyzer errors out in that case:
https://github.com/Azure-Samples/azure-search-openai-demo/actions/runs/5612367638/job/15205930925

    Directory: /home/runner/work/azure-search-openai-demo/azure-search-openai-demo
    Error: An exception occurred while analyzing template /home/runner/work/azure-search-openai-demo/azure-search-openai-demo/infra/main.bicep with parameters file /home/runner/work/azure-search-openai-demo/azure-search-openai-demo/infra/main.parameters.json
    Exception details:
    Microsoft.Azure.Templates.Analyzer.Core.TemplateAnalyzerException: Error while processing template.
     ---> Azure.Deployments.Templates.Exceptions.TemplateValidationException: The value for the template parameter 'openAiResourceGroupLocation' at line '83' and column '36' is not provided. Please see https://aka.ms/arm-create-parameter-file for usage details.

I tried providing test.parameters.json with it filled in, but that doesn't work due to issue #47

It'd be great if either #47 was fixed or if it didn't error with an unprovided parameter.

@aakanshaverma1310
Copy link

@pamelafox - Hi, are you using azure devops pipeline task "MicrosoftSecurityDevOps@1" ?
If yes then I have a query-
How are you passing GDN_TEMPLATEANALYZER_ANALYZEDIRECTORY environment variable for scanning bicep template.

in my case I have a folder which has the bicep template.

I have tried below, but thats not working and scanning the complete repo.
image

If you have any suggestions , pls do share

@pamelafox
Copy link
Member Author

I am using a GitHub action workflow, not ADO pipeline, which you can see in my attempted PR: https://github.com/Azure-Samples/azure-search-openai-demo/pull/444/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants