A DevOps team is setting up self-hosted build agents to deploy resources to Azure. The build agents run on a mix of Windows Server, Ubuntu Linux, and macOS. The deployment pipelines include scripts that utilize both Azure CLI commands and Azure PowerShell cmdlets. Which of the following statements is correct regarding where these scripts can be executed?
- AAzure CLI scripts can be executed on all three operating systems, but Azure PowerShell scripts can only be executed on Windows Server.
- Both the Azure CLI and Azure PowerShell scripts can be executed locally on all three operating systems (Windows Server, Ubuntu Linux, and macOS).Cevap
- CAzure PowerShell scripts can be executed on all three operating systems, but Azure CLI scripts can only be executed on Ubuntu Linux and macOS.
- DNeither script can be executed locally on Ubuntu Linux or macOS, meaning these build agents must connect to Azure Cloud Shell to run the commands.
Cevap
Both the Azure CLI and Azure PowerShell scripts can be executed locally on all three operating systems (Windows Server, Ubuntu Linux, and macOS).
Both Azure CLI and Azure PowerShell are designed to be cross-platform. Azure CLI has installers for Windows, macOS, and Linux. Azure PowerShell utilizes PowerShell Core, which is also cross-platform, allowing the same Az module cmdlets to run on Windows, macOS, and Linux systems. This means both types of scripts can be executed locally on all three agent operating systems.
Adım Adım Çözüm
Anahtar Kavram
Azure CLI and Azure PowerShell cross-platform compatibility