az bicep prints version information when check_version is false
Describe the bug
When publishing bicep modules ("az publish") to our container registry, we receive the below output for each file:
Bicep CLI is already installed at '/agent/_work/_temp/.azclitask/bin/bicep'. Skipping installation as no specific version was requested.
We deploy around 100 files to the registry. This line is printed for every file, bloats the output and makes troubleshooting tedious.
We set the below flag, but it does not stop the output:
az config set bicep.check_version=false
Possible source: https://github.com/Azure/azure-cli/blob/2a6319e38494ba1a316b04391ad0d8a8cf86068b/src/azure-cli/azure/cli/command_modules/resource/_bicep.py#L137C13-L137C18
Related command
az config set bicep.check_version=false
az bicep publish --file $filePath --target "br:*****.azurecr.io/infrastructure/bicep/imports:$importName" --with-source --force
Errors
Bicep CLI is already installed at '/agent/_work/_temp/.azclitask/bin/bicep'. Skipping installation as no specific version was requested.
Issue script & Debug output
cli.knack.cli: Command arguments: ['bicep', 'publish', '--file', '.\Bicep\Imports\Functions.bicep', '--target', 'br:.azurecr.io/infrastructure/bicep/imports:functions', '--with-source', '--force', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x000001417BCD45E0>, <function OutputProducer.on_global_arguments at 0x000001417C261940>, <function CLIQuery.on_global_arguments at 0x000001417C2BB880>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'bicep': ['azure.cli.command_modules.resource']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: resource 1.245 52 234
cli.azure.cli.core: Total (1) 1.245 52 234
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: Total (0) 0.000 0 0
cli.azure.cli.core: Loaded 52 groups, 234 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : bicep publish
cli.azure.cli.core: Command table: bicep publish
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x000001417E9F11C0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '.azure\commands\2025-12-26.09-59-08.bicep_publish.25284.log'.
az_command_data_logger: command args: bicep publish --file {} --target {} --with-source --force --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.
Expected behavior
Setting bicep check_version=false should disable version related outputs, or version related outputs should be behind --debug.
Environment Summary
az --version
azure-cli 2.81.0
core 2.81.0 telemetry 1.1.0
Extensions: account 0.2.5 application-insights 1.2.3 automation 1.0.0b1 azure-devops 1.0.2 azure-firewall 2.0.0 datafactory 1.0.4 dns-resolver 1.2.0 front-door 1.4.0 logic 1.1.0 maintenance 1.7.0b1 ml 2.40.1 monitor-control-service 1.2.0 notification-hub 2.0.0b1 portal 1.0.0b2 reservation 0.3.1 resource-graph 2.1.1 site-recovery 1.0.0 ssh 2.0.6
Dependencies: msal 1.34.0b1 azure-mgmt-resource 23.3.0
Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe' Config directory 'C:\Users\HalWaggoner.azure' Extensions directory 'C:\Users\HalWaggoner.azure\cliextensions'
Python (Windows) 3.13.9 (tags/v3.13.9:8183fa5, Oct 14 2025, 14:09:13) [MSC v.1944 64 bit (AMD64)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
az bicep version
Bicep CLI version 0.39.26 (1e90b06e40)
Additional context
No response
Thank you for opening this issue, we will look into it.
This is also very annoying when you want handle the output of an deployment: e.g.
$output = az deployment group create | convertto-json
This causing an invalid json file
Same here. I am unable to normally parse output as a valid json now, only by parsing json object manually.
This is the same as https://github.com/Azure/azure-cli/issues/32549
On Linux, you can retrieve JSON using the sed command as shown in the code snippet below:
DEPLOYMENT_OUTPUTS=$($AZ deployment group create \
--resource-group $RESOURCE_GROUP_NAME \
--only-show-errors \
--template-file $TEMPLATE \
--parameters $PARAMETERS \
--parameters location=$LOCATION \
--query 'properties.outputs' \
--output json
DEPLOYMENT_JSON=$(echo "$DEPLOYMENT_OUTPUTS" | sed -n '/{/,$ p')
echo "$DEPLOYMENT_JSON" | jq .
This issue is specific to output clutter in the pipeline logs, not readability of json and therefore not a duplicate of 32549.
@yonzhan, the PR that closed 32549 may fix json output, but does not appear to reduce output bloat. Any guidance or update?
Thanks for the clear report, and @a0x1ab for the root-cause write-up.
I reproduced this on 2.85.0: even with az config set bicep.check_version=false, an az bicep command still prints
Bicep CLI is already installed at '...'. Skipping installation as no specific version was requested.
to stdout (stderr stays empty). As @a0x1ab identified, in resource/_bicep.py that line is emitted by ensure_bicep_installation(...) and is gated only by an internal stdout flag — not by bicep.check_version. So the config flag doesn't suppress it, and because it lands on stdout it can corrupt captured JSON (the point @BasBerk and @sdzunenko raised). And as you clarified on April 7, this log-bloat is distinct from the JSON-formatting issue in #32549.
So this is a confirmed bug. Will triage this with the team.
Bug Analysis: az bicep publish prints version info when check_version=false
Issue: When az config set bicep.check_version=false is set, the message "Bicep CLI is already installed at '...'. Skipping installation as no specific version was requested." is still printed for each az bicep publish call, bloating output especially when publishing many files.
Root Cause: The message is printed unconditionally in src/azure-cli/azure/cli/command_modules/resource/_bicep.py around line 137, regardless of the bicep.check_version config setting. The check_version flag only controls whether version checking is performed, but the "already installed" message should also be suppressed when this flag is false.
Fix: In src/azure-cli/azure/cli/command_modules/resource/_bicep.py, guard the "already installed / skipping installation" log/print statement so it is only emitted when check_version=true (or equivalent config is enabled). The fix should ensure the message is not printed when bicep.check_version=false.
Steps to reproduce:
az config set bicep.check_version=false- Run
az bicep publish --file <file> --target <target>multiple times - Observe: "Bicep CLI is already installed..." message appears each time
Expected: No installation-related output when check_version=false.
PR title & description format (required)
This repo enforces a PR format (guide). Please author the PR exactly as follows or CI's Check the Format of Pull Request Title and Content will fail.
Title
- Start with
[Resource]— square brackets[]for a customer-facing change (added toHISTORY.rst), curly{}if not. A bug fix is customer-facing, so use[]. - Then
Fix #32578:to link the issue. - Then optionally the affected command
az <command>:. - Then a present-tense, capitalized verb (Fix for bug fixes; Add/Change/Deprecate/Remove otherwise) and a concise summary.
- Recommended title:
[Resource] Fix #32578: az <command>: Fix <concise description of the fix>
Description — follow the PR template and fill in:
- Link the issue — start the Description with a closing keyword so the PR auto-links and closes it:
Fixes #32578. - Related command — the
az ...command this affects. - Description (mandatory) — why the bug happens, what you changed, and the resulting behavior.
- Testing Guide — example command(s) showing the fix works.
- History Notes — leave the title to drive the history note, or add
[Resource] az <command>: <note>lines for extra notes. - Keep the template checklist and tick the items you've satisfied.
Posted by agent-assist (autonomous bug-fix pipeline).