Exercise – Explore Interaction with Azure
In this exercise, you will explore different ways to interact with Microsoft Azure. You can interact with Azure in several ways, including through the web portal or by using the Azure Command-Line Interface (CLI) with PowerShell or Bash commands.
Access the Azure Portal
The Azure portal provides a graphical user interface (GUI) to interact with Azure services.
You can navigate through different service areas, manage your subscriptions and accounts, search for specific services or settings, and more.
The Azure portal is accessible at the following address:
🔗 https://portal.azure.com
Once signed in to the portal, you can navigate Azure through the graphical interface or use the command-line interface with PowerShell or Bash commands.
Use the Command-Line Interface
You can use the CLI directly from the Azure portal.
Once signed in to Azure, access the CLI by selecting the Cloud Shell icon.
Launching Cloud Shell opens a CLI window in PowerShell or Bash mode.
If you are familiar with PowerShell, you can manage your Azure environment using PowerShell commands.
To access Cloud Shell from the Azure portal, simply select the Cloud Shell icon.

You can quickly switch between PowerShell and Bash in the CLI by selecting the “Switch to…” button or simply by entering BASH or PWSH.

Tip
When you are in PowerShell mode, the command line starts with PS.
When you are in Bash mode, it starts with your_username@azure.

Use PowerShell in the CLI
Use the PowerShell Get-Date command to obtain the current date and time.
The Get-Date command is specific to PowerShell.
Most Azure-specific commands start with the letters az.
Now, let’s try an Azure command to check the version of the CLI you are currently using.
az versionUse Bash in the CLI
If you are more comfortable with Bash, you can use Bash commands by switching to the Bash CLI.
Enter the bash command to switch to the Bash interface in the CLI.
💡 Tip
You can tell you are in Bash mode by the username displayed in the command line, in the format:
your_username@azure
Once again, use the Get-Date command to obtain the current date and time.
You received an error because Get-Date is a PowerShell-specific command.

Use the date command to get the current date and time
Just like in PowerShell mode in the CLI, use the letters az to start an Azure command in Bash mode.
Try running a CLI update with the command:
az upgradeSwitch back to PowerShell mode
You can return to PowerShell mode by entering the command:
pwshUse the Azure CLI Interactive Mode
Another way to interact with Azure is by using the Azure CLI interactive mode.
This mode changes the behavior of the CLI to resemble more of an Integrated Development Environment (IDE).
The interactive mode offers:
- Autocompletion
- Command descriptions
- Usage examples
If you are not familiar with Bash or PowerShell but still want to use the command line, the interactive mode can be helpful.
Access interactive mode
Enter the command:
az interactive
to access interactive mode.
Choose whether to send telemetry data
You will need to decide whether you want to send telemetry data: enter YES or NO.
Wait for initialization
You may need to wait one to two minutes for interactive mode to be fully ready.
Then, type the letter a, and autocompletion should start working.
If it doesn’t, wait a little longer and try again.

Once initialized, you can use the arrow keys or the Tab key to automatically complete your commands.
The interactive mode is specifically designed for Azure, so you do not need to type az to start a command.
Try the upgrade or version commands again, but this time without az in front.
The commands should work the same way as before and give you the same results.
Use the exit command to leave interactive mode.
Continue
You’re ready. Proceed with the training.