هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
$ مستخدم عادي# بصلاحية root (أو مع sudo)
Command-Line & Scripting Tools for Azure Management
Azure CLI is a command-line tool for Azure.
- It runs on Windows, macOS, Linux, and Azure Cloud Shell.
- CLI commands look like
az <service> <action>. az loginsigns you in. A service principal lets a script sign in.- CLI output can be JSON, table, or TSV.
- Azure PowerShell uses cmdlets from the Az module.
Connect-AzAccountsigns you in.- PowerShell fits Windows and hybrid environments.
- Both tools create, change, and delete resources.
- Both tools work inside scripts and pipelines.
In more detail
- Every resource needs a resource group, so make one first.
- CLI:
az group create --name demo --location eastus. - PowerShell:
New-AzResourceGroup -Name demo -Location eastus. - Add
--output tableto read CLI results more easily. - Use
Get-AzResourceoraz resource listto see what exists. - Scripts repeat the same steps with no typing errors.
- Keep scripts in Git so you can see every change.
- Many teams put these scripts in a CI/CD pipeline.
Infrastructure as Code (IaC) for Resource Deployment
IaC means you define infrastructure in code.
- ARM templates are JSON files. They describe the end state.
- Declarative means you say what you want, not the steps.
- Templates use parameters, variables, and outputs.
- Dependencies tell Azure the right order for resources.
- You can validate a template before you deploy it.
- Bicep is a small language that compiles to ARM JSON.
bicep decompileturns an ARM template into Bicep.- Modules split a big template into small parts.
- Keep templates in Git and deploy from a pipeline.
In more detail
- Put changing values, like location or size, in parameters.
- Use a variable for a value that repeats inside the template.
- Use an output to return a value after the deploy.
- Deploy a group template with
az deployment group create. - In PowerShell, use
New-AzResourceGroupDeployment. - A Bicep resource line has a type, an API version, and a name.
- Small modules are easier to read and test.
- Run a validation first, so errors show up early.
Web-Based & Browser-Based Azure Management
Azure Portal is a web GUI for Azure.
- You can create VMs, storage, networks, and databases with clicks.
- The portal shows dashboards, metrics, alerts, and logs.
- Access Control (IAM) in the portal manages roles.
- Azure Cloud Shell is a terminal inside the browser.
- Cloud Shell includes Azure CLI, PowerShell, Git, and Terraform.
- Cloud Shell keeps files in an Azure Files share.
- You can open Cloud Shell from the portal, the mobile app, or a URL.
- The portal is good for looking and for quick changes.
- The portal is not good for repeatable work.
- CLI and PowerShell are better for scripts.
- Bicep and ARM templates are better for whole environments.
In more detail
- Use the portal to learn a service and to check resources.
- Use Cloud Shell when you need a command but have no tools installed.
- Use CLI or PowerShell when a task must run the same way each time.
- Use Bicep or ARM templates to build a full environment.
- Pick the tool that fits the job, not the tool you like most.
- The course compares six tools: CLI, PowerShell, ARM, Bicep, Portal, and Cloud Shell.
- Each tool has one weak point. For example, the portal is weak for automation.
- Cloud Shell has no rich UI for deep troubleshooting.
Key terms
The words of this course in one table. Learn them before the quiz or exam.
| Term | Meaning |
|---|---|
| 01 | CLI and PowerShell — commands and scripts. |
| 02 | Infrastructure as Code — ARM templates and Bicep. |
| 03 | Web-based tools — portal and Cloud Shell. |
| ARM template | The JSON file that describes Azure resources. |
| Automation | Running tasks without a person clicking. |
| Az module | The PowerShell module that holds Azure cmdlets. |
| Azure CLI | The cross-platform command tool for Azure. |
| Azure Cloud Shell | A browser terminal with Azure tools ready. |
| Azure Files | The file share that keeps Cloud Shell files. |
| Azure Portal | The web interface for Azure. |
| Azure PowerShell | The PowerShell module set for Azure. |
| Bash | A common Linux command shell. |
| Bicep | The readable language for ARM deployments. |
| Cloud Shell | A browser terminal with Azure tools ready. |
| Cmdlet | A PowerShell command, like Get-AzVM. |
| Dashboard | One page with charts and key numbers. |
| Declarative | A style where you state the wanted result. |
| Decompile | Convert an ARM template into Bicep. |
| Dependency | A link that sets the resource order. |
| Git | Version control for scripts and templates. |
| GUI | A screen with buttons and menus. |
| IaC | Infrastructure as Code: infrastructure written as files. |
| IAM | Access Control, the page for roles and access. |
| Module | A small Bicep or ARM file you reuse. |
| Output | A value returned after the deploy. |
| Output format | The shape of a command result: JSON, table, or TSV. |
| Parameter | A value that you pass in at deploy time. |
| Pipeline | An automated build and deploy process. |
| Resource group | The box that holds related resources. |
| Resource management | Create, change, and delete Azure resources. |
| Script | A file of commands that runs in order. |
| Service principal | An app identity that scripts use to sign in. |
| Terraform | A tool that builds infrastructure from code. |
| Variable | A value used inside the template. |
Check yourself
Answer each question first, then open it to check the answer.
1What does a CLI command start with?
It starts with az, then the service, then the action.
2Which command signs you in to Azure PowerShell?
Connect-AzAccount.
3Why do teams use scripts instead of the portal?
Scripts are faster, repeatable, and free of typing errors.
4What is the difference between a parameter and a variable?
A parameter comes from outside at deploy time. A variable is set inside the file.
5Why is Bicep easier than raw ARM JSON?
It removes heavy JSON brackets and keeps the same result.
6What does bicep decompile do?
It converts an existing ARM template into a Bicep file.
7Name two tools that come pre-installed in Cloud Shell.
Azure CLI and Azure PowerShell (also Git and Terraform).
8Why is the portal a poor choice for repeatable deployments?
You must click the same steps again, so small differences slip in.
9Where does Cloud Shell keep your files between sessions?
In an Azure Files share that stays with your account.
Useful links
Official documentation and pages for this course.
- Azure CLI docs — command reference.
- Azure PowerShell docs — cmdlet reference.
- Bicep docs — language and modules.
- Azure Cloud Shell docs — the browser terminal.