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

Bicep 0.4.412 always writes to standard error #3638

Closed
afscrome opened this issue Jul 16, 2021 · 10 comments · Fixed by #3686
Closed

Bicep 0.4.412 always writes to standard error #3638

afscrome opened this issue Jul 16, 2021 · 10 comments · Fixed by #3686
Assignees
Labels
bug Something isn't working
Milestone

Comments

@afscrome
Copy link
Contributor

Bicep version
Bicep CLI version 0.4.412 (f1169d0)

Describe the bug
In our pipeline, we build our bicep template before deploying it. We want to get behaviour similar to .Net's "Warning as Errors", so we've configured our task to fail if anything is written to standard error. This worked in previous bicep versions, however the latest bicep version has broken this as it appears to write the following text to standard error

WARNING: Build succeeded: 0 Warning(s), 0 Error(s)

To Reproduce
Have a devops task like the following, and attempt to build a valid bicep file. That task will error, even if bicep hasn't failed.

        - task: CmdLine@2
          displayName: 'Transpile Bicep Template'
          inputs:
            failOnStderr: true
            script: az bicep build --file '${{ parameters.bicepTemplate }}' --outfile '$(transpiledFileFullPath)'

Additional context
In #3285, I can see the recommendation is to look for Exit Code rather than look at standard error, but that a build with warnings still produces an exit code of 0.

Do you have an alternative recommendation for how to fail on warnings

@ghost ghost added the Needs: Triage 🔍 label Jul 16, 2021
@afscrome
Copy link
Contributor Author

I've tried to mitigate this by downgrading to an older bicep version, however that now fails is it writes a helpful out of date warning to std error 😂

WARNING: A new Bicep release is available: v0.4.412. Upgrade now by running "az bicep upgrade".

@johan-lindqvist
Copy link
Contributor

Having the same issue with Azure/arm-deploy and with the Azure CLI (Azure/arm-deploy#70 (comment))

@thesushil
Copy link

Same issue, my temporary workaround is to remove failOnStderr:true, not ideal!

@majastrz
Copy link
Member

This is caused by the new build summary capability that was added in #3195. The AZ CLI and AZ PS have to be modified to pass the --no-summary switch.

@alex-frankel
Copy link
Collaborator

Can you try installing an older version in the meantime?

az bicep install --version v0.4.63

@afscrome
Copy link
Contributor Author

@alex-frankel since the older version now writes an upgrade message to stderr so that is also broken

WARNING: A new Bicep release is available: v0.4.412. Upgrade now by running "az bicep upgrade".

@majastrz
Copy link
Member

The version warning is coming from Az CLI and not from Bicep CLI, so we will need to deal with it separately. We will modify Bicep CLI to stop emitting the summary and cut a new release this week.

@majastrz majastrz self-assigned this Jul 20, 2021
@majastrz majastrz added bug Something isn't working and removed Needs: Triage 🔍 labels Jul 20, 2021
@majastrz majastrz added this to the v0.5 milestone Jul 20, 2021
@majastrz
Copy link
Member

New release with the fix should come by the end of this week (most likely sooner).

@afscrome
Copy link
Contributor Author

My builds are working again with this morning's 0.4.451 release. Thanks @majastrz for the quick turn around.

@majastrz
Copy link
Member

np - glad it's working now.

@ghost ghost locked as resolved and limited conversation to collaborators May 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants