azure-cli: az bicep build broken in CLI 2.22.0
az feedback
auto-generates most of the information requested below, as of CLI version 2.0.62
Describe the bug
Running az bicep build
gives a python error:
The command failed with an unexpected error. Here is the traceback:
type object 'datetime.datetime' has no attribute 'fromisoformat'
Traceback (most recent call last):
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 657, in execute
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 691, in _run_job
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/__init__.py", line 807, in default_command_handler
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/custom.py", line 3294, in build_bicep_file
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/_bicep.py", line 63, in run_bicep_command
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/_bicep.py", line 152, in _load_bicep_version_check_result_from_cache
AttributeError: type object 'datetime.datetime' has no attribute 'fromisoformat'
To Reproduce
- Upgrade to Azure CLI 2.22.0
- Run
az bicep build -f somefile.bicep
Expected behavior
Bicep build should work
Environment summary
Installed using az upgrade
and repaired using the MSI. Both don’t work.
Windows 10, x64. az bicep build
command ran from a git bash terminal.
Additional context
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 16 (8 by maintainers)
That’s great @zhoxing-ms
I just updated to the latest version and everything works again. Thanks for the quick response 👍
@IJsbrandVV Hi, we released a new version (
2.22.1
) of hotfix to address this issue today. Please upgrade CLI to the latest version (2.22.1
) and try again.@zhoxing-ms already submitted a PR: https://github.com/Azure/azure-cli/pull/17675. Can you take a look?
I get the same when trying to run a deployment via
az deployment...
I am running the deployment from a fresh build of my Docker container built this morning: https://github.com/fluffy-cakes/devops_tools/