IntermediateLesson 5 of 9

Azure Access Methods

Understand when to use Azure Portal, Azure CLI, and Azure PowerShell for effective day-to-day operations.

What is it? (Simple Explanation)

Azure can be managed through a website (Portal) or command tools (CLI and PowerShell).

Why do we need it?

Real-world Analogy

Portal is a dashboard, CLI is a command keypad, and PowerShell is an automation control room.

How it works (Technical)

All methods call Azure APIs underneath. Choice depends on task type: one-off inspection, repeatable script, or object-rich administration workflow.

Visual Representation

Tool Selection Matrix
Portal
Visual, low entry barrier
CLI
Fast scripts, JSON outputs
PowerShell
Objects, pipelines, Windows admin fit

Commands / Syntax

CLI and PowerShell
# Azure CLI
az login
az account show
az group list --output table

# Azure PowerShell
Connect-AzAccount
Get-AzSubscription
Get-AzResourceGroup

Example (Real-world Use Case)

An engineer investigates an alert in Portal, then uses CLI to export resource inventory, and finally uses PowerShell to bulk-apply governance tags.

Hands-on

  1. Sign in through Portal and locate one resource group.
  2. Run CLI command to list same group.
  3. Run PowerShell command to retrieve same data.
  4. Compare output style (visual vs JSON/text vs objects).
  5. Document which method you would use for repeatable weekly tasks.

Try It Yourself

Create a short script to list all resource groups and their tags.

Debugging Scenario

Issue: Command fails with authorization error. Check: account context (tenant/subscription), login state, and RBAC role assignment.

Interview Questions

Beginner

What is Azure Portal best for?

Visual management, discovery, and quick troubleshooting.

What is Azure CLI best for?

Cross-platform scripting and fast command-line operations.

Why use Azure PowerShell?

Object-based automation and strong Windows admin workflows.

Intermediate

Can Portal/CLI/PowerShell do the same tasks?

Mostly yes, but ergonomics and automation suitability differ.

How choose between CLI and PowerShell?

CLI for lightweight scripts; PowerShell for object-rich and Windows-centric automation.

What is common source of command failures?

Wrong subscription/tenant context or missing role permissions.

Scenario-based

Need quick one-time config check.

Use Portal first for speed and visibility.

Need nightly inventory export.

Use CLI/PowerShell script with scheduled execution.

Command works for teammate but not you.

Compare RBAC role, tenant, and subscription context.

Real-world Usage

Effective cloud teams mix all three methods: Portal for insight, CLI/PowerShell for repeatability.

Summary

Choose tools by purpose, not preference: visual checks in Portal, automation in CLI/PowerShell.