question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az command returns 0 when failing

See original GitHub issue

Related command az extension show -n azure-ml-cli

Describe the bug When azure-ml-cli is not installed, we expect an error with exitcode 1. This works properly for 2.39 and older, but with 2.40, it returns 0.

To Reproduce Run the following python script:

import subprocess
subprocess.run(args=['pwsh', '-EncodedCommand', 'YQB6ACAAZQB4AHQAZQBuAHMAaQBvAG4AIABzAGgAbwB3ACAALQBuACAAYQB6AHUAcgBlAC0AYwBsAGkALQBtAGwA'])

Outputs 2.40 image 2.39 image

Expected behavior CompletedProcess(args=[‘pwsh’, ‘-EncodedCommand’, ‘YQB6ACAAZQB4AHQAZQBuAHMAaQBvAG4AIABzAGgAbwB3ACAALQBuACAAYQB6AHUAcgBlAC0AYwBsAGkALQBtAGwA’], returncode=1)

Environment summary Windows, python 3.8

Additional context Similar to https://github.com/Azure/azure-cli/issues/23808

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yonzhancommented, Oct 4, 2022

https://github.com/Azure/azure-cli/milestone/122 Build to Cloud Shell: 10/10/2022 Official Release: 10/12/2022

1reaction
yjm607commented, Sep 14, 2022

Hi Yong, will there be an IcM ticket filed for this issue? It is affecting all customers of the Substrate Intelligence AI platform and the Shrike library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I get a powershell script to exit with a non-zero code ...
When an az cli command returns an error the script keeps executing like nothing happened which is problematic.
Read more >
while trying to run the az run command with the powershell ...
i am trying to run the below az run command but facing the error ... are trying to use RunPowerShellScript from azure CLI...
Read more >
Azure Pipeline Step Fails Even Though Exit Code is 0
... failed with error: Error: /bin/bash failed with return code: 0 ... Some programs write logging messages to stderr (e.g. az --version ...
Read more >
AZ Cli reports warnings that breaks Releases
az : WARNING: The default kind for created storage account will change to ... 'C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe' failed with exit ...
Read more >
BashPitfalls - Greg's Wiki
If the command substitution returns multiple filenames, there is no way ... (This example still fails if we initialize i to -1 instead...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found