AZ-104 - Administration - Azure CLI and Powershell
Install PowerShell on Windows, Linux, and macOS
How to install the Azure CLI
What is the Azure CLI
- Its a command-line utility for managing azure resources
- Crate and manage resources without logging to the azure portal
- Create scripts to automate tasks
What is Azure PowerShell
- Its a set of cmdlets for managing Azure resources
- Create and manage resource s without logging into the azure portal
- Create scripts to automate tasks.
Cloud Shell
First we need to create a Cloud Shell
Select Bash or Powershell
Go to Advanced settings
Select a random storage account name and a file share name then click on create storage
if you get this error its more likely your storage account name its already in use, use alphanumeric
Done, you can switch between Powershell and Bash using the drop down menu on the left
Here we can run AZ CLI commands
And here is using the powershell
We can save objects to variables
To create a virtual machine from Azure CLI
PS /home/cesar> get-cloudDrive
FileShareName : random1fileshare
FileSharePath : //random1storage4.file.core.windows.net/random1fileshare
MountPoint : /home/cesar/clouddrive
Name : random1storage4
ResourceGroupName : DefaultResourceGroup-CUS
StorageAccountName : random1storage4
SubscriptionId : 33d9a849-c6f5-455d-b9e4-ef89b317fcec
PS /home/cesar> get-azresource | format-Table
Name ResourceGroupName ResourceType Location
---- ----------------- ------------ --------
DefaultWorkspace-33d9a849-c6f5-455d-b9e4-ef89b317fcec-CUS DefaultResourceGroup-CUS Microsoft.OperationalInsights/workspaces centralus
random1storage4 DefaultResourceGroup-CUS Microsoft.Storage/storageAccounts eastus
NetworkWatcher_eastus NetworkWatcherRG Microsoft.Network/networkWatchers eastus
PS /home/cesar>