Trying to upgrade to v0.15.31 with az bicep upgrade, the command fails with an unexpected error.
Describe the bug
Command Name
az bicep upgrade
Errors:
Installing Bicep CLI v0.15.31...
The command failed with an unexpected error. Here is the traceback:
No section: 'bicep'
Traceback (most recent call last):
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 663, in execute
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 697, in _run_job
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 333, in __call__
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/custom.py", line 3657, in upgrade_bicep_cli
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/_bicep.py", line 141, in ensure_bicep_installation
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/config.py", line 99, in get
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/config.py", line 94, in get
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/config.py", line 208, in get
File "configparser.py", line 783, in get
File "configparser.py", line 1154, in _unify_values
configparser.NoSectionError: No section: 'bicep'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
To open a new issue, please run `az feedback`
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- Put any pre-requisite steps here...
az bicep upgrade
Expected Behavior
Upgrade completed successfully to v0.15.31.
Environment Summary
Windows-10-10.0.22621-SP0
Python 3.10.10
Installer: MSI
azure-cli 2.46.0
Extensions:
azure-firewall 0.14.5
bastion 0.2.3
containerapp 0.3.22
ssh 1.1.3
Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1
Additional Context
Thank you for your feedback. This has been routed to the support team for assistance.
route to CXP team
this is also happening with a fresh install, and older versions

also, it works sometimes...

@YuKogasaka Thanks for the feedback! We have worked up a PR to address this.
Please do note that despite this error, the bicep CLI is installed and can be used as usual.
@YuKogasaka Thanks for the feedback! We have worked up a PR to address this.
Please do note that despite this error, the
bicepCLI is installed and can be used as usual.
This is not correct - i.e. the bicep installed with an az cli installation is broken in the same way:
##[error]Error: Command failed: az bicep build --file /agent/_work/1/s/templates/DevTestLabs/dtl_main.bicep ERROR: The command failed with an unexpected error. Here is the traceback: ERROR: No section: 'bicep'
@robmaw Thanks for the feedback! This is a workaround in the meantime is to manually set the config value before the fix is out.
az config set bicep.use_binary_from_path=false
az bicep install