azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Trying to upgrade to v0.15.31 with az bicep upgrade, the command fails with an unexpected error.

Open YuKogasaka opened this issue 3 years ago • 7 comments

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

YuKogasaka avatar Mar 08 '23 05:03 YuKogasaka

Thank you for your feedback. This has been routed to the support team for assistance.

ghost avatar Mar 08 '23 08:03 ghost

route to CXP team

yonzhan avatar Mar 08 '23 08:03 yonzhan

this is also happening with a fresh install, and older versions

image

also, it works sometimes... image

@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.

PramodValavala-MSFT avatar Mar 08 '23 21:03 PramodValavala-MSFT

@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.

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 avatar Mar 09 '23 23:03 robmaw

@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

PramodValavala-MSFT avatar Mar 10 '23 18:03 PramodValavala-MSFT