If any az command like 'az artifacts universal download *' or 'az artifacts universal publish *' fails, how to capture error code at bash?
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@contactvikasgupta Thanks for your question. We are checking on this and will respond to you soon.
@contactvikasgupta Apologies for delayed response.
If you want to capture just the error code, after you run the az command try to run echo $? for getting the error code.
Please try below commands on bash to capture the az cli command verbose output into file
command >outfile.txt 2>&1 this will redirect both stdout and stderr to the outputfile.
command > outfile.txt 2> error.txt if you want them separated.
​
@contactvikasgupta We will now proceed to close this thread. If there are further questions regarding this matter, please comment and we will gladly continue the discussion.
Thanks, this worked.
@contactvikasgupta Thank you for the confirmation.