{"id":304,"date":"2021-04-19T14:13:08","date_gmt":"2021-04-19T14:13:08","guid":{"rendered":"https:\/\/thecloudmarathoner.com\/?p=304"},"modified":"2021-12-02T06:12:35","modified_gmt":"2021-12-02T06:12:35","slug":"error-on-bicep-module-on-azure-cli-2-22-0-for-windows-10","status":"publish","type":"post","link":"https:\/\/thecloudmarathoner.com\/index.php\/2021\/04\/19\/error-on-bicep-module-on-azure-cli-2-22-0-for-windows-10\/","title":{"rendered":"Resolving error on Bicep module &#8211; on Azure CLI (2.22.0) for Windows 10"},"content":{"rendered":"\n<p>If you are seeing &#8220;fromisoformat&#8221; error while running <code>az bicep version<\/code> or any other <code>az bicep<\/code> command &#8211; you are not alone \ud83d\ude42<\/p>\n\n\n\n<p>Check this open issue reported on GitHub by community member &#8211; <a href=\"https:\/\/github.com\/Azure\/azure-cli\/issues\/17718\">https:\/\/github.com\/Azure\/azure-cli\/issues\/17718<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1018\" height=\"730\" src=\"\/wp-content\/uploads\/2021\/04\/az-bicep-error.jpg\" alt=\"\" class=\"wp-image-305\" srcset=\"\/wp-content\/uploads\/2021\/04\/az-bicep-error.jpg 1018w, \/wp-content\/uploads\/2021\/04\/az-bicep-error-300x215.jpg 300w, \/wp-content\/uploads\/2021\/04\/az-bicep-error-768x551.jpg 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p><br>After updating to the latest Azure CLI (2.22.0) for Windows 10, I am now seeing the same error as others have reported:<\/p>\n\n\n\n<p>Any command such as &#8220;az bicep version&#8221; is producing the following error:<\/p>\n\n\n\n<p>The command failed with an unexpected error. <br>Here is the traceback and detailed error:<br><code>type object 'datetime.datetime' has no attribute 'fromisoformat'<br>Traceback (most recent call last):<br>File \"D:\\a\\1\\s\\build_scripts\\windows\\artifacts\\cli\\Lib\\site-packages\\knack\/cli.py\", line 231, in invoke<br>File \"D:\\a\\1\\s\\build_scripts\\windows\\artifacts\\cli\\Lib\\site-packages\\azure\/cli\/core\/commands\/<strong>init<\/strong>.py\", line 657, in execute<br>File \"D:\\a\\1\\s\\build_scripts\\windows\\artifacts\\cli\\Lib\\site-packages\\azure\/cli\/core\/commands\/<strong>init<\/strong>.py\", line 720, in _run_jobs_serially<br>File \"D:\\a\\1\\s\\build_scripts\\windows\\artifacts\\cli\\Lib\\site-packages\\azure\/cli\/core\/commands\/<strong>init<\/strong>.py\", line 691, in _run_job<br>File \"D:\\a\\1\\s\\build_scripts\\windows\\artifacts\\cli\\Lib\\site-packages\\azure\/cli\/core\/commands\/<strong>init<\/strong>.py\", line 328, in&nbsp;<strong>call<\/strong><br>File \"D:\\a\\1\\s\\build_scripts\\windows\\artifacts\\cli\\Lib\\site-packages\\azure\/cli\/core\/<strong>init<\/strong>.py\", line 807, in default_command_handler<br>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<br>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<br>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<br>AttributeError: type object 'datetime.datetime' has no attribute 'fromisoformat'<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is there a temp workaround?<\/h3>\n\n\n\n<p>One of the workarounds is to uninstalled Azure CLI 2.22.0 , and then install the prior version 2.21.0. You could confirm 2.21.0 version is working for you by running the same command.<br><\/p>\n\n\n\n<p>Hope this will be helpful for you, as i faced with this issue hours before my demo to #GlobalAzure 2021 \ud83d\ude10 <\/p>\n<div class=\"pvc_clear\"><\/div><p id=\"pvc_stats_304\" class=\"pvc_stats all  \" data-element-id=\"304\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p><div class=\"pvc_clear\"><\/div>","protected":false},"excerpt":{"rendered":"<p>If you are seeing &#8220;fromisoformat&#8221; error while running az bicep version or any other az bicep command &#8211; you are not alone \ud83d\ude42 Check this open issue reported on GitHub by community member &#8211; https:\/\/github.com\/Azure\/azure-cli\/issues\/17718 After updating to the latest Azure CLI (2.22.0) for Windows 10, I am now seeing the same error as others &hellip; <a href=\"https:\/\/thecloudmarathoner.com\/index.php\/2021\/04\/19\/error-on-bicep-module-on-azure-cli-2-22-0-for-windows-10\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Resolving error on Bicep module &#8211; on Azure CLI (2.22.0) for Windows 10&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,4,7,2,18],"tags":[],"class_list":["post-304","post","type-post","status-publish","format-standard","hentry","category-azure-bicep","category-azure-devops","category-git-github","category-infrastructure-as-code-iac","category-azure"],"_links":{"self":[{"href":"https:\/\/thecloudmarathoner.com\/index.php\/wp-json\/wp\/v2\/posts\/304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecloudmarathoner.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecloudmarathoner.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecloudmarathoner.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thecloudmarathoner.com\/index.php\/wp-json\/wp\/v2\/comments?post=304"}],"version-history":[{"count":5,"href":"https:\/\/thecloudmarathoner.com\/index.php\/wp-json\/wp\/v2\/posts\/304\/revisions"}],"predecessor-version":[{"id":785,"href":"https:\/\/thecloudmarathoner.com\/index.php\/wp-json\/wp\/v2\/posts\/304\/revisions\/785"}],"wp:attachment":[{"href":"https:\/\/thecloudmarathoner.com\/index.php\/wp-json\/wp\/v2\/media?parent=304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecloudmarathoner.com\/index.php\/wp-json\/wp\/v2\/categories?post=304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecloudmarathoner.com\/index.php\/wp-json\/wp\/v2\/tags?post=304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}