SkarpSkarp

Chapter 15 of 20

Managing Azure Resources: Azure Portal, CLI, PowerShell, and ARM Templates

Compare the main tools you can use to create and manage Azure resources—from the graphical portal to command-line tools and templates—and see where each shines.

27 min readen

Big Picture: The Four Azure Management Tools

The Four Azure Management Tools

For AZ-900, know the four Azure management tools: Azure portal, Azure PowerShell, Azure Command-Line Interface (CLI), and Azure Resource Manager templates.

All Talk to Azure Resource Manager

All four tools send requests to Azure Resource Manager (ARM), which checks permissions and policies, then creates or changes Azure resources.

Why This Matters for the Exam

You must list the four tools, describe each at a high level, and choose the best tool for a scenario based on interactivity, automation, and scale.

Azure Portal: The Web-Based Control Center

What Is the Azure Portal?

The Azure portal is a browser-based graphical interface for creating, configuring, and monitoring Azure resources using dashboards, blades, and wizards.

When the Portal Shines

It is ideal for learning, exploring services, doing one-off changes, and visually monitoring resources with charts, dashboards, and activity logs.

Portal Trade-offs

The portal is manual and click-heavy. It is not ideal for repeating the same deployment at scale or for strict automation and version control.

Azure PowerShell: Scripting for .NET and Windows Admins

What Is Azure PowerShell?

Azure PowerShell is a collection of PowerShell modules that let you manage Azure resources using cmdlets in scripts or an interactive shell.

Why Use Azure PowerShell?

It is great for automation, scheduled tasks, and integrating Azure with existing PowerShell-heavy workflows, especially in Windows-centric environments.

PowerShell vs Portal

Compared to the portal, PowerShell is less visual but much better for repeatable tasks, bulk operations, and storing scripts in version control.

Azure CLI: Cross-Platform Command-Line Management

What Is Azure CLI?

The Azure Command-Line Interface (CLI) is a cross-platform command-line tool for managing Azure using commands like `az group create` and `az vm list`.

Where Azure CLI Fits

Azure CLI is popular with developers and Linux/macOS users, great for automation, scripting in Bash, and running quickly in Azure Cloud Shell.

CLI vs PowerShell

Both manage Azure via ARM. Choose CLI when the team prefers Bash and cross-platform tooling; choose PowerShell when PowerShell skills already exist.

Azure Resource Manager Templates: Infrastructure as Code

What Are ARM Templates?

Azure Resource Manager templates are JSON files that describe Azure infrastructure so that Azure Resource Manager can deploy it consistently.

Infrastructure as Code

ARM templates support infrastructure as code: you store templates in source control, review them, and redeploy the same design across environments.

When to Use Templates

Choose ARM templates for repeatable, standardized, large deployments where consistency, automation, and compliance are critical.

Side-by-Side: One Task in Four Tools

Portal Example: Create a Resource Group

In the portal, you click Resource groups > Create, enter `rg-sales-dev`, pick `eastus`, then Review + create. Visual and manual.

PowerShell and CLI Example

PowerShell: `New-AzResourceGroup -Name "rg-sales-dev" -Location "eastus"`. CLI: `az group create --name rg-sales-dev --location eastus`.

Template Perspective

With an ARM template, you define the resource group and other resources in JSON and deploy the template for repeatable, versioned environments.

Quick Look at Commands and a Minimal ARM Template

These snippets are for recognition, not memorization. Focus on what each tool is doing, not every option.

  1. Azure PowerShell: create a storage account

```powershell

Assumes you already created the resource group

$rg = "rg-sales-dev"

$location = "eastus"

$storageName = "salesdevstorage123" # must be globally unique

New-AzStorageAccount \

-ResourceGroupName $rg \

-Name $storageName \

-Location $location \

-SkuName "Standard_LRS" \

-Kind "StorageV2"

```

  1. Azure CLI: create the same storage account

```bash

rg="rg-sales-dev"

location="eastus"

storageName="salesdevstorage123"

az storage account create \

--resource-group $rg \

--name $storageName \

--location $location \

--sku Standard_LRS \

--kind StorageV2

```

  1. Minimal ARM template: define a storage account

```json

{

"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",

"contentVersion": "1.0.0.0",

"parameters": {

"storageAccountName": {

"type": "string"

},

"location": {

"type": "string",

"defaultValue": "eastus"

}

},

"resources": [

{

"type": "Microsoft.Storage/storageAccounts",

"apiVersion": "2023-01-01",

"name": "[parameters('storageAccountName')]",

"location": "[parameters('location')]",

"sku": {

"name": "Standard_LRS"

},

"kind": "StorageV2",

"properties": {}

}

]

}

```

On AZ-900, you will not be asked to write this code, but you may see references to JSON templates and should recognize that as Azure Resource Manager templates.

Match Scenario to Tool: Thought Exercise

Work through these scenarios and decide which of the four tools best fits. Then compare with the guidance.

  1. Scenario A: A new administrator, unfamiliar with scripting, needs to quickly spin up a test virtual machine and see its status on a dashboard.
  • Best tool? Azure portal
  • Why: Visual, beginner friendly, easy monitoring.
  1. Scenario B: Your team already has many PowerShell scripts to manage on-premises Windows servers. You want to add Azure VM start/stop automation to those scripts.
  • Best tool? Azure PowerShell
  • Why: Reuses existing skills and script ecosystem.
  1. Scenario C: A developer on macOS wants to automate creating and deleting dev environments from their terminal using Bash scripts.
  • Best tool? Azure Command-Line Interface (CLI)
  • Why: Cross-platform, Bash friendly.
  1. Scenario D: Your organization wants every project to deploy the same network, security groups, and policies to dev, test, and production, with all changes reviewed in Git.
  • Best tool? Azure Resource Manager templates
  • Why: Infrastructure as code, version-controlled, repeatable.
  1. Scenario E: You need to apply tags to hundreds of existing resources across multiple resource groups on a schedule.
  • Best tools? Azure PowerShell or Azure CLI
  • Why: Scriptable bulk updates, easy to schedule.

Pause and mentally justify each choice; this is very close to how AZ-900 frames its management-tool questions.

Quick Check 1: Identify the Tool

Test your ability to map descriptions to the correct Azure management tool.

Which Azure management tool is best described as JSON-based definitions for deploying infrastructure as code?

  1. Azure portal
  2. Azure PowerShell
  3. Azure Command-Line Interface (CLI)
  4. Azure Resource Manager templates
Show Answer

Answer: D) Azure Resource Manager templates

Azure Resource Manager templates are JSON-based definitions that describe the desired state of your infrastructure, enabling infrastructure as code. The portal is graphical, PowerShell and CLI are scripting/command-line tools.

Quick Check 2: Scenario-Based Choice

Apply what you have learned to a realistic scenario.

Your company wants to standardize deployments so that every environment (dev, test, prod) is created in exactly the same way from a version-controlled file. Which Azure management tool is the BEST fit for this requirement?

  1. Azure portal
  2. Azure PowerShell
  3. Azure Command-Line Interface (CLI)
  4. Azure Resource Manager templates
Show Answer

Answer: D) Azure Resource Manager templates

The goal is standardized, repeatable deployments from a version-controlled file. That is exactly the purpose of Azure Resource Manager templates (infrastructure as code). Portal, PowerShell, and CLI can deploy resources but do not inherently enforce a JSON-defined, versioned infrastructure model.

Flashcards: The Four Azure Management Tools

Use these flashcards to reinforce the names and core ideas of each tool.

List the four Azure management tools you must know for AZ-900.
The four Azure management tools are: "Azure portal", "Azure PowerShell", "Azure Command-Line Interface (CLI)", "Azure Resource Manager templates".
What is the Azure portal?
The Azure portal is a web-based graphical interface for managing Azure resources using dashboards, blades, and wizards, ideal for interactive, visual management and learning.
What is Azure PowerShell best used for?
Azure PowerShell is a scripting and automation tool for managing Azure resources using PowerShell cmdlets, especially suitable for Windows admins and environments that already use PowerShell.
What is the Azure Command-Line Interface (CLI)?
The Azure Command-Line Interface (CLI) is a cross-platform command-line tool for managing Azure resources, popular with developers and Linux/macOS users, and ideal for scripting in shells like Bash.
Conceptually, what are Azure Resource Manager templates?
Azure Resource Manager templates are JSON-based definitions for deploying infrastructure as code, describing the desired state of Azure resources so that Azure Resource Manager can deploy them consistently.
Which tool is most appropriate for a non-technical stakeholder who wants to check resource status and costs visually?
The Azure portal, because it provides visual dashboards, charts, and an easy-to-navigate web interface.
Which tools are best for bulk, scripted operations like tagging hundreds of resources?
Azure PowerShell and Azure Command-Line Interface (CLI), because both support scripting and automation for large-scale, repeatable tasks.
Which tool is most tightly associated with the phrase "infrastructure as code" on AZ-900?
Azure Resource Manager templates, because they define infrastructure in JSON files that can be stored, reviewed, and versioned like code.

Putting It Together: Choosing the Right Tool on the Exam

Remember the Canonical List

The four Azure management tools are: Azure portal, Azure PowerShell, Azure Command-Line Interface (CLI), and Azure Resource Manager templates.

Keyword Mapping

Portal: visual/browser. PowerShell: cmdlets, Windows admins. CLI: cross-platform, Bash. ARM templates: JSON, infrastructure as code, repeatable.

Avoiding Exam Traps

Look for hints like "JSON template" or "Bash on Linux" to choose the right tool, and remember all tools go through Azure Resource Manager with RBAC and Azure Policy.

Key Terms

Azure Policy
Azure Policy is a service in Azure that you use to create, assign, and manage policies that enforce rules and effects over your resources, so those resources stay compliant with your corporate standards and service level agreements.
Azure portal
A web-based graphical interface for creating, configuring, and monitoring Azure resources using dashboards, blades, and wizards.
Azure PowerShell
A set of PowerShell modules that provide cmdlets for managing Azure resources through scripts or an interactive PowerShell session.
Azure Resource Manager (ARM)
The deployment and management service for Azure that provides a management layer for creating, updating, and deleting resources, and that enforces role-based access control and Azure Policy.
Infrastructure as Code (IaC)
A practice where infrastructure is defined and managed using machine-readable configuration files, such as Azure Resource Manager templates, enabling repeatable, version-controlled deployments.
Azure Resource Manager templates
JSON-based definitions that describe the desired state of Azure resources so that Azure Resource Manager can deploy infrastructure as code in a repeatable, consistent way.
role-based access control (RBAC)
Role-based access control (RBAC) is an authorization system built on Azure Resource Manager that provides fine-grained access management of Azure resources based on roles assigned to users, groups, and service principals.
Azure Command-Line Interface (CLI)
A cross-platform command-line tool for managing Azure resources using commands such as `az group create` and `az vm list`, commonly used in Bash and other shells.

Finished reading?

Test your understanding with a custom practice exam on this chapter.

Test yourself