az bicep install with termination command prevents it from installing on second try
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
### **This is autogenerated. Please review and update as needed.**
## Describe the bug
When installing bicep via `az bicep install` and quickly pressing Ctrl + C to cancel, because I wasn't in admin mode, I can no longer install/ upgrade bicep from the az cli as it shows the following error:
OSError: [WinError 193] **%1** is not a valid Win32 application
**Command Name**
`az bicep upgrade`
**Errors:**
```
The command failed with an unexpected error. Here is the traceback:
[WinError 193] %1 is not a valid Win32 application
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/commands/command_operation.py", line 121, in handler
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/custom.py", line 3418, in upgrade_bicep_cli
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/_bicep.py", line 93, in ensure_bicep_installation
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/_bicep.py", line 171, in _get_bicep_installed_version
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/_bicep.py", line 205, in _run_command
File "subprocess.py", line 493, in run
File "subprocess.py", line 858, in __init__
File "subprocess.py", line 1311, in _execute_child
OSError: [WinError 193] %1 is not a valid Win32 application
```
## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- `az bicep install`
- Ctrl + C within 1 second
- `az bicep upgrade`
## Expected Behavior
## Environment Summary
```
Windows-10-10.0.19041-SP0
Python 3.8.9
Installer: MSI
azure-cli 2.26.1
```
## Additional Context
Contributor guide
Assessment
This issue has not been assessed yet.