0
0
Azurecloud~5 mins

Azure Portal walkthrough - Commands & Configuration

Choose your learning style9 modes available
Introduction
Azure Portal is a website where you can manage your cloud resources easily. It helps you create, view, and control services like virtual machines and databases without needing to write code.
When you want to create a new virtual machine without using command lines.
When you need to check the status of your cloud services quickly.
When you want to set up storage accounts or databases with a simple interface.
When you want to monitor usage and billing information for your cloud resources.
When you want to manage user access and permissions for your cloud projects.
Commands
This command logs you into your Azure account from the command line so you can manage resources. It opens a browser window to enter your credentials.
Terminal
az login
Expected OutputExpected
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code ABCD1234 to authenticate. You have logged in. Now let us find all the subscriptions to which you have access... [{ "cloudName": "AzureCloud", "homeTenantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "id": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy", "isDefault": true, "name": "My Azure Subscription", "state": "Enabled", "tenantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "user": { "name": "user@example.com", "type": "user" } }]
This command creates a resource group named 'example-resource-group' in the East US region. Resource groups help organize your cloud resources.
Terminal
az group create --name example-resource-group --location eastus
Expected OutputExpected
{ "id": "/subscriptions/yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy/resourceGroups/example-resource-group", "location": "eastus", "managedBy": null, "name": "example-resource-group", "properties": { "provisioningState": "Succeeded" }, "tags": {}, "type": "Microsoft.Resources/resourceGroups" }
--name - Specifies the name of the resource group
--location - Specifies the Azure region for the resource group
This command creates a virtual machine named 'example-vm' in the resource group. It uses an Ubuntu image and sets up SSH keys for secure login.
Terminal
az vm create --resource-group example-resource-group --name example-vm --image UbuntuLTS --admin-username azureuser --generate-ssh-keys
Expected OutputExpected
{ "fqdns": "", "id": "/subscriptions/yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/example-vm", "location": "eastus", "macAddress": "00-0D-3A-XX-XX-XX", "powerState": "VM running", "privateIpAddress": "10.0.0.4", "publicIpAddress": "52.170.XX.XX", "resourceGroup": "example-resource-group", "zones": "" }
--resource-group - Specifies the resource group to place the VM in
--name - Names the virtual machine
--image - Chooses the operating system image
--admin-username - Sets the admin user for the VM
--generate-ssh-keys - Creates SSH keys for secure access
This command lists all virtual machines with details like status and IP addresses in a readable table format.
Terminal
az vm list -d -o table
Expected OutputExpected
Name ResourceGroup Location Zones Size OsType ProvisioningState PowerState ---------- -------------------- ---------- ------- ------- -------- ------------------- ------------ example-vm example-resource-group eastus Standard_B1s Linux Succeeded VM running
-d - Shows instance view details like power state
-o table - Formats output as a table for easy reading
Key Concept

If you remember nothing else from this pattern, remember: Azure Portal and CLI let you create and manage cloud resources easily without needing complex code.

Common Mistakes
Trying to create resources without logging in first
Commands fail because Azure does not know who you are or what subscription to use
Always run 'az login' first to authenticate your session
Using resource group names or locations that do not exist or are misspelled
Azure cannot place resources in unknown groups or regions, causing errors
Create the resource group first and double-check the location name before creating resources
Not generating SSH keys or providing admin credentials when creating a VM
You cannot securely access the VM without proper credentials
Use '--generate-ssh-keys' or specify admin username and password during VM creation
Summary
Use 'az login' to sign into your Azure account from the command line.
Create a resource group to organize your cloud resources.
Create a virtual machine with a chosen image and secure access.
List your virtual machines to check their status and details.