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?
- Portal is great for visual discovery and quick checks.
- CLI is fast for cross-platform scripting and automation.
- PowerShell is strong for Windows-focused operations and object-based workflows.
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
Commands / Syntax
# 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
- Sign in through Portal and locate one resource group.
- Run CLI command to list same group.
- Run PowerShell command to retrieve same data.
- Compare output style (visual vs JSON/text vs objects).
- 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
Visual management, discovery, and quick troubleshooting.
Cross-platform scripting and fast command-line operations.
Object-based automation and strong Windows admin workflows.
Intermediate
Mostly yes, but ergonomics and automation suitability differ.
CLI for lightweight scripts; PowerShell for object-rich and Windows-centric automation.
Wrong subscription/tenant context or missing role permissions.
Scenario-based
Use Portal first for speed and visibility.
Use CLI/PowerShell script with scheduled execution.
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.