Add debugging output for Azure SSH provider #145
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves the Azure SSH debugging experience by adding debug output for the various
az
commands being run before opening thessh
/scp
session. Specifically, when the--debug
flag is set, the CLI will output the stdout and stderr for all theaz
commands it runs. Note though that it won't set the--debug
flag for theaz
commands themselves as this outputs far too much information, with the exception of theaz network bastion tunnel
command; while it still outputs far too much information in debug mode, it has an unfortunate tendency to hide certain errors unless you pass it the--debug
flag, so I did add it there.Some additional information is also logged by the CLI itself now when the
--debug
flag is set.Testing
Tested locally against my Azure VM in our test tenant, both with and without the
--debug
flag.Screenshots
Example output when not using
--debug
; matches output from before this PR (as before, sensitive redaction value by my terminal, not the CLI):Examples of output when using
--debug
:Initial startup:
Generating Azure AD SSH certificate:
Starting tunnel (and showing repro commands added in previous PR):
Closing SSH session and shutting down tunnel: