Posts

Showing posts with the label Azure-CLI

HOW TO capture entire interactive session output in Azure Cloud Shell

Image
While trying out Azure CLI 2 commands, I liked the rich details that were shown as the command output. I learnt that the history command gets the list of commands typed by me in the bash mode of Azure Cloud Shell but I couldn't figure how to capture the output of all Azure CLI commands that I typed. I was looking for a way that the command output could be logged so that I can download the entire interactive session as a text file for review later. I asked on Microsoft Q&A forum and got a wonderfully detailed answer The trick is to use the script command to record your session. This will capture all your commands and output to a file you specify. However, you need to ensure you run the script command to start recording and exit once you want to end. If you want to append the commands to the same file use script -a filename to the same file name you specify. To download the session recording file, use the Download file option from the Azure Cloud Shell menu - Altern...