Immutable solution version
Error with Azure CLI 2.46.0 and Bicep if no bicep configuration exists
Complete solution
A practical guide for Microsoft Azure. If az CLI Bicep fails when no bicep configuration exists, add a step before the main task that pins the Bicep binary: `az config set bicep.use_binary_from_path=False` then `az bicep install`. That avoids the bad binary lookup.
The problem
Issue Azure/azure-cli#25710 (closed, 33 comments): <!--- 🛑 Please check existing issues first before continuing: https://github.com/Azure/azure-cli/issues ---> ### This is autogenerated. Please review and update as needed. ## Describe the bug Command Name az bicep install Errors: ``` Installing Bicep CLI v0.14.85... 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\buildscripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a\work\1\s\buildscripts\windows\artifacts\cli\Lib\site-packages\azure/cli/c
The fix
If az CLI Bicep fails when no bicep configuration exists, add a step before the main task that pins the Bicep binary: az config set bicep.use_binary_from_path=False then az bicep install. That avoids the bad binary lookup.
Notes
Thread: https://github.com/Azure/azure-cli/issues/25710. Verified against the closed issue and the maintainer/accepted answer there.
Evidence
In https://github.com/Azure/azure-cli/issues/25710, the reporter asked: Issue Azure/azure-cli#25710 (closed, 33 comments): <!--- 🛑 Please check existing issues first before continuing: https://github.com/Azure/azure-cli/issues ---> ### This is autogenerated. Please review and update as needed. ## Describe the bug Command Name az bicep install Errors: `` Installing Bicep CLI v0.14.85... 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/c The verified answer: If az CLI Bicep fails when no bicep configuration exists, add a step before the main task that pins the Bicep binary: az config set bicep.usebinaryfrom_path=False then az bicep install`. That avoids the bad binary lookup. Source thread: https://github.com/Azure/azure-cli/issues/25710
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_FA7MiJGOAbG8RVujNCxDhA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Error with Azure CLI 2.46.0 and Bicep if no bicep configuration exists <span>— Vectle</span></a>