Soru

Zorluk: OrtaAzure Portal, CLI, PowerShell, and Cloud Shell

An administrator needs to write an automation script that will run locally on macOS, Linux, and Windows workstations to create and manage Azure resources. The script must utilize command-line syntax with the `az` prefix (such as `az group create`) and output results in JSON format.

Which tool should be installed on the local workstations to execute this script?

  1. A
    Azure PowerShell
  2. Azure CLICevap
  3. C
    Azure Portal
  4. D
    Azure Cloud Shell

Cevap

Azure CLI
The correct answer is Azure CLI. Azure CLI is a cross-platform command-line tool that runs locally on Windows, macOS, and Linux. It uses the 'az' command prefix (such as 'az group create') and outputs JSON formatted text by default, which aligns perfectly with all the requirements in the scenario.

Adım Adım Çözüm

1
Identify the environment and syntax requirements.
The workstations run multiple operating systems (macOS, Linux, and Windows), requiring a cross-platform tool. The syntax uses the 'az' prefix (e.g., 'az group create') and outputs JSON.
Matching these requirements helps filter out tools that do not support this specific command structure, output format, or local installation mode.
2
Compare the features of Azure CLI and Azure PowerShell.
Azure CLI is cross-platform, uses the 'az' command structure, and outputs JSON by default. Azure PowerShell is also cross-platform but uses verb-noun cmdlets (e.g., 'New-AzResourceGroup') and outputs objects.
This step distinguishes between the two primary command-line options based on command syntax and output format.
3
Evaluate the requirement for local installation.
Both Azure CLI and Azure PowerShell can be installed locally. Azure Cloud Shell is browser-based and not installed locally. The Azure Portal is a web-based graphical interface.
This step confirms that the selected tool satisfies the installation constraints.

Anahtar Kavram

Azure CLI is a cross-platform command-line tool that uses commands starting with the 'az' prefix and outputs JSON by default, making it suitable for scripting across Windows, macOS, and Linux environments.
Bu soruyu puanla