Bird
Raised Fist0
Azurecloud~5 mins

What is Azure - CLI Guide

Choose your learning style10 modes available
Introduction
Azure is a service that lets you use computers and storage over the internet instead of your own. It helps you run websites, store files, and use software without needing your own machines.
When you want to create a website that can handle many visitors without buying servers.
When you need to store backups safely and access them from anywhere.
When you want to run apps that can grow or shrink automatically based on users.
When you want to try new software without installing it on your computer.
When you want to connect your office computers to powerful cloud tools.
Commands
This command signs you into Azure so you can start using its services from the command line.
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": "Visual Studio Enterprise", "state": "Enabled", "tenantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "user": { "name": "user@example.com", "type": "user" } }]
This command creates a container called a resource group where you can keep related Azure resources together in the East US region.
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 - Sets the name of the resource group
→
--location - Specifies the Azure region for the resources
This command creates a virtual machine named example-vm inside the resource group, using Ubuntu Linux and setting up secure login keys.
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", "name": "example-vm", "powerState": "VM running", "privateIpAddress": "10.0.0.4", "publicIpAddress": "52.170.12.34", "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 name for the VM
→
--generate-ssh-keys - Creates SSH keys for secure login
This command lists all virtual machines with details in a readable table format to check their status and IP addresses.
Terminal
az vm list -d -o table
Expected OutputExpected
Name ResourceGroup Location Zones PowerState PublicIP PrivateIP ----------- --------------------- ---------- ------- ------------ ------------- --------- example-vm example-resource-group eastus VM running 52.170.12.34 10.0.0.4
→
-d - Shows instance view details like power state
→
-o table - Formats output as a table
Key Concept

If you remember nothing else from Azure, remember: it lets you use powerful computers and storage over the internet so you don't need your own hardware.

Common Mistakes
Trying to use Azure commands without logging in first
Azure needs you to sign in to know who you are and what you can do
Always run 'az login' before other Azure commands
Creating resources without specifying a resource group
Azure organizes resources in groups; missing this causes errors or scattered resources
Use the --resource-group flag to keep resources organized
Not generating SSH keys when creating a Linux VM
Without SSH keys, you cannot securely connect to the VM
Use --generate-ssh-keys or provide your own keys during VM creation
Summary
Use 'az login' to sign into Azure from the command line.
Create a resource group to organize your cloud resources.
Launch virtual machines with specific images and secure access.
Check your virtual machines' status and IP addresses with a list command.

Practice

(1/5)
1. What is Microsoft Azure primarily used for?
easy
A. Using computers and storage over the internet
B. Writing desktop software only
C. Creating video games on a local machine
D. Managing personal files on your computer

Solution

  1. Step 1: Understand Azure's main purpose

    Azure provides cloud services like computing and storage accessible via the internet.
  2. Step 2: Compare options with Azure's purpose

    Only the option 'Using computers and storage over the internet' matches Azure's purpose.
  3. Final Answer:

    Using computers and storage over the internet -> Option A
  4. Quick Check:

    Azure = cloud computing and storage [OK]
Hint: Azure is about internet-based computing and storage [OK]
Common Mistakes:
  • Thinking Azure is only for desktop software
  • Confusing local software development with cloud services
  • Assuming Azure manages personal files locally
2. Which of the following is a correct way to describe Azure?
easy
A. A cloud platform offering virtual machines and databases
B. A local software installed on your PC
C. A video editing tool
D. A social media website

Solution

  1. Step 1: Identify Azure's service offerings

    Azure offers cloud services like virtual machines and databases.
  2. Step 2: Match description to Azure

    A cloud platform offering virtual machines and databases correctly describes Azure as a cloud platform with these services.
  3. Final Answer:

    A cloud platform offering virtual machines and databases -> Option A
  4. Quick Check:

    Azure = cloud platform with many services [OK]
Hint: Azure provides cloud services like VMs and databases [OK]
Common Mistakes:
  • Thinking Azure is software installed locally
  • Confusing Azure with unrelated tools or websites
  • Ignoring Azure's cloud service nature
3. If you create a virtual machine in Azure, what happens?
medium
A. A physical computer is sent to your home
B. A virtual computer runs on Azure's servers accessible online
C. Your local computer speed increases automatically
D. Your internet connection is replaced

Solution

  1. Step 1: Understand virtual machines in Azure

    Azure virtual machines are computers running on Azure's cloud servers, accessible via the internet.
  2. Step 2: Evaluate options

    Only A virtual computer runs on Azure's servers accessible online correctly describes this cloud-based virtual machine concept.
  3. Final Answer:

    A virtual computer runs on Azure's servers accessible online -> Option B
  4. Quick Check:

    Azure VM = virtual computer in cloud [OK]
Hint: Azure VMs run online, not sent physically [OK]
Common Mistakes:
  • Thinking Azure sends physical hardware
  • Assuming local computer speed changes
  • Confusing internet connection with VM creation
4. You tried to create a storage account in Azure but got an error. Which is a likely cause?
medium
A. Your computer is turned off
B. You typed your password incorrectly
C. You did not select a valid region for the storage account
D. You forgot to install Azure on your PC

Solution

  1. Step 1: Identify common Azure storage account errors

    Choosing an invalid or unsupported region often causes creation errors.
  2. Step 2: Check other options

    Typing password or computer off won't cause Azure cloud errors; Azure is not installed locally.
  3. Final Answer:

    You did not select a valid region for the storage account -> Option C
  4. Quick Check:

    Invalid region causes Azure storage error [OK]
Hint: Check region selection when Azure storage errors occur [OK]
Common Mistakes:
  • Blaming local PC issues for cloud errors
  • Confusing Azure cloud with local software
  • Ignoring region selection importance
5. You want to build a website that can handle many visitors without buying servers. How does Azure help?
hard
A. Azure only stores files but cannot run websites
B. Azure sends you physical servers to install at home
C. Azure requires you to buy hardware first
D. Azure lets you rent virtual machines and storage that scale automatically

Solution

  1. Step 1: Understand Azure's scalability features

    Azure provides virtual machines and storage that can grow or shrink based on visitor demand.
  2. Step 2: Evaluate options for website hosting

    Azure lets you rent virtual machines and storage that scale automatically correctly states Azure's ability to rent scalable resources without buying hardware.
  3. Final Answer:

    Azure lets you rent virtual machines and storage that scale automatically -> Option D
  4. Quick Check:

    Azure = scalable cloud resources for websites [OK]
Hint: Azure scales resources for websites without hardware [OK]
Common Mistakes:
  • Thinking Azure sends physical servers
  • Believing Azure cannot run websites
  • Assuming hardware purchase is needed
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard