1.5. Navigating the Azure Portal and CLI
š” First Principle: The choice between a graphical interface (Portal) and a command-line interface (CLI) is a fundamental decision that impacts administrative efficiency, repeatability, and the ability to automate cloud operations at scale.
Scenario: You need to perform a quick, one-time check of a Virtual Machine's settings. Later, you also need to automate the deployment of a complex Azure environment for a new project.
Azure offers two main interfaces for managing resources: the Azure Portal and the Azure Command-Line Interface (CLI). Each is designed for different workflows and user preferences, but both interact with the same underlying Azure Resource Manager (ARM) API.
What It Is:
- Azure Portal: A web-based graphical interface accessed via a browser.
- Azure CLI: A cross-platform command-line tool (
az
) for managing resources via commands.
Key Differences and Strengths:
Feature | Azure Portal | Azure CLI |
---|---|---|
Interface | Graphical User Interface (GUI) | Command-Line Interface (CLI) |
Accessibility | Web-based, requires a browser | Cross-platform (Windows, macOS, Linux), requires terminal |
Ease of Use | Intuitive, discoverable, best for new users, visual tasks | Requires learning commands, ideal for experienced users |
Automation | Limited direct automation; primarily manual interaction | Highly scriptable, integrates well with DevOps pipelines |
Workflow | Exploring resources, ad-hoc configuration, troubleshooting visually | Repetitive tasks, bulk operations, repeatable deployments (IaC) |
Feedback | Visual dashboards, wizards, integrated monitoring | Fast, direct output to terminal, suitable for parsing output |
Practical Implementation: Creating a Resource Group
- Azure CLI:
# Login to Azure az login # Create a resource group az group create --name MyResourceGroup --location eastus
- Azure Portal:
- Navigate to "Resource groups" in the portal.
- Click "+ Create".
- Fill in the subscription, resource group name, and region.
- Click "Review + create", then "Create".
Visual: Azure Portal vs. Azure CLI Interactions
Loading diagram...
ā ļø Common Pitfall: Relying exclusively on the Azure Portal for production deployments. This leads to manual, error-prone processes that are not repeatable or auditable.
Key Trade-Offs:
- Speed of Exploration (Portal) vs. Speed of Execution (CLI): The Portal is faster for exploring and learning about new services. The CLI is faster for executing known, repetitive tasks.
Reflection Question: How does strategically choosing between the Azure Portal (for visual tasks) and the Azure CLI (for automation) fundamentally impact your efficiency and the repeatability of your Azure administration tasks?