هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
$ مستخدم عادي# بصلاحية root (أو مع sudo)
Azure Monitor and Alerts
Azure Monitor collects metrics and logs from your Azure resources.
- A dashboard shows the key numbers in one place. You pin charts to it.
- RBAC decides who can view or change a dashboard.
- An alert rule watches one signal: a metric, a log query, or an activity log event.
- An action group runs the response: email, SMS, webhook, Logic App, or runbook.
- Severity levels are Informational, Warning, and Critical.
- Dynamic thresholds learn the normal pattern and alert on a change.
- KQL is the query language for logs.
- A Log Analytics Workspace stores logs from many resources in one place.
- VM Insights, Application Insights, and Container Insights are ready-made monitors.
- Cost Management shows spending and budgets.
- Alerts plus automation can fix a problem with no human click.
In more detail
- Create a dashboard and pin the metrics you check every day.
- Write an alert rule: scope, condition, severity, and action group.
- Try dynamic thresholds when a fixed number is too noisy.
- Send logs to one workspace. Query them with KQL.
- Turn on VM Insights for CPU, memory, and dependency maps.
- Use Application Insights for slow APIs, and Container Insights for clusters.
- Set a budget alert, so you hear about cost early.
- Read old trends to plan capacity, then scale out or scale up.
Backup and Recovery
Azure Backup saves copies of VMs, file shares, and SQL databases.
- Backups are incremental. Only the changes since the last backup are stored.
- A Recovery Services Vault holds backup data and Site Recovery settings.
- Geo-redundant storage keeps a copy in a second Azure region.
- You can restore a whole VM, or only some files.
- Azure Site Recovery (ASR) copies VMs to another region for failover.
- RPO is how much data you can lose. RTO is how long you can be down.
- A planned failover has no data loss. An unplanned failover may lose a little.
- Failback moves work back to the primary site.
- A test failover runs in an isolated network, so live work is safe.
- Alerts warn you when replication is late or broken.
In more detail
- Pick the critical workloads first. Give each one an RPO and an RTO.
- Set a backup policy: how often it runs and how long it keeps copies.
- Azure Backup encrypts data with AES-256 by default. Use Key Vault keys if you need control.
- Watch backup reports and alerts for failed jobs.
- Enable replication, then watch replication health and the RPO value.
- Test failover on a schedule. Clean up the test resources after.
- Use both: backup protects data, ASR keeps the service running.
- Keep replication cheap: compress data, skip temp files, and copy at off-peak hours.
Cost Optimization with Azure Advisor
Azure Advisor gives personal recommendations for your resources.
- It has four areas: cost, performance, security, and operational excellence.
- Advisor finds idle VMs, oversized VMs, and unused storage.
- Right-sizing means a VM size that matches real CPU and memory use.
- Shut down or deallocate what you do not use.
- Move cold data to a cheaper tier, like the Blob Archive tier.
- A Reserved Instance is a 1-year or 3-year commitment. It can save up to 72%.
- A Spot Instance is cheap, but Azure can take it back. Use it for batch jobs.
- Cost Management + Billing tracks spend, budgets, and alerts.
- Tags group costs by project, team, or environment.
- Azure Hybrid Benefit reuses your Windows and SQL licenses, for up to 85% less licensing cost.
- Reserved Capacity covers storage, SQL Database, and Cosmos DB.
In more detail
- Open Advisor. Start with the cost items that save the most.
- Resize, shut down, or delete waste. Then read the cost report again.
- Set a budget, and alerts at 50%, 75%, and 100%.
- Tag every resource. Use Azure Policy to make tagging a rule.
- Buy a reservation only for steady workloads. Check the usage first.
- Turn on Hybrid Benefit for eligible Windows Server and SQL Server VMs.
- Check reservations before the renewal date, and change the size if needed.
- Watch the spending report after each change. Keep what helps.
Performance Tuning – Optimizing Workloads & Identifying Bottlenecks
Performance tuning finds the slow part and fixes it.
- Watch CPU, memory, disk I/O, and network throughput.
- High CPU for a long time means the VM needs a bigger size or more VMs.
- IOPS and latency show how fast storage answers.
- Network Watcher finds latency, packet loss, and bandwidth limits.
- Azure Resource Health shows if the problem is in Azure or in your app.
- Scale up means a bigger VM. Scale out means more VMs with a load balancer.
- Azure Cache for Redis keeps hot data in memory, so the database works less.
- A CDN keeps static files near users.
- Use the right storage tier: Premium for hot data, Archive for old logs.
- SQL Database can scale by DTU or by vCore.
- Alerts and Log Analytics help you find the cause fast.
In more detail
- Set alerts on CPU over 80% and memory over 75%.
- Query logs with KQL, for example the average CPU for each hour.
- Open Application Insights for a slow API. Find the slow dependency.
- Fix slow queries and add the missing indexes.
- Put a load balancer in front when you scale out.
- Right-size first. Then scale out only when you need it.
- Use ExpressRoute for heavy data moves between regions.
- Change one thing, then measure again.
Key terms
The words of this course in one table. Learn them before the quiz or exam.
| Term | Meaning |
|---|---|
| 01 | Azure Monitor and Alerts |
| 02 | Backup and Recovery |
| 03 | Cost Optimization with Azure Advisor |
| 04 | Performance Tuning |
| Action group | The list of actions that run when an alert fires. |
| Alert rule | A rule that fires when a signal meets a condition. |
| Application Insights | A monitor for app requests, errors, and dependencies. |
| Azure Advisor | A service that gives best-practice recommendations. |
| Azure Cache for Redis | An in-memory cache service. |
| Azure Hybrid Benefit | Use your own Windows or SQL licenses in Azure. |
| Azure Site Recovery (ASR) | A service that copies VMs to a second region. |
| Bottleneck | The part that limits the speed of the whole system. |
| Budget | A spending limit with alerts in Cost Management. |
| CDN | A network of servers that serves static files near users. |
| Connection Monitor | A Network Watcher tool for end-to-end links. |
| Container Insights | A monitor for containers, pods, and nodes. |
| Cost Management + Billing | The tool for cost analysis and budgets. |
| Dashboard | A page that shows charts and logs from many resources. |
| Deallocate | Stop a VM and release its compute. |
| DTU | A unit of SQL Database power. |
| Failback | Move workloads back to the primary site. |
| Failover | Move workloads to the secondary site. |
| Geo-redundant storage | Copies data to a second region. |
| Incremental backup | Saves only the changed data. |
| IOPS | Input/output operations per second, a disk speed measure. |
| KQL | Kusto Query Language, used to query logs. |
| Latency | The delay before data comes back. |
| Log Analytics Workspace | The central store for log data. |
| Microsoft Sentinel | A cloud SIEM for threat detection and response. |
| Network Watcher | A tool for network traffic and connection checks. |
| Planned failover | A failover with no data loss, used for maintenance. |
| Recovery point | The moment in time that a backup can restore. |
| Recovery Services Vault | The container for backup and recovery data. |
| Reserved Capacity | A 1 or 3 year commitment for storage or databases. |
| Reserved Instance | A 1 or 3 year commitment for a lower price. |
| Resource Health | The current health status of one Azure resource. |
| Right-sizing | Changing a resource to match real use. |
| RPO | The most data you can lose, measured in time. |
| RTO | The longest time a system may be down. |
| Severity | How urgent an alert is: Informational, Warning, or Critical. |
| Spot Instance | A cheap VM that Azure can take back. |
| Tag | A key-value label on a resource, used for cost tracking. |
| Test failover | A failover test in a separate network. |
| Traffic Analytics | A Network Watcher tool for bandwidth and packet loss. |
| vCore | A virtual CPU unit for SQL Database scaling. |
| VM Insights | A ready-made view of VM performance and health. |
Check yourself
Answer each question first, then open it to check the answer.
1Which parts does an alert rule need?
A scope (the resource), a condition, a severity, and an action group.
2What is the difference between a metric alert and a log alert?
A metric alert watches a number, like CPU. A log alert runs a KQL query and checks the result.
3What does an action group do?
It sends messages and starts a response, like a runbook, a Logic App, or a ticket.
4Your RPO is 1 hour. How often do you back up?
Every hour.
5Why do we run a test failover?
To check the plan and the copies without touching live work.
6What does ASR do when the primary region fails?
It fails the workloads over to the second region.
7A VM runs at 3% CPU for 30 days. What does Advisor say?
It flags the VM as underused and suggests a resize or a shutdown.
8When is a Spot Instance a good choice?
For batch, test, or other work that can stop and start again.
9Which two things do you need before you buy a reservation?
Steady usage data and a clear 1 or 3 year plan.
10CPU stays at 90% on one VM every day. What can you do?
Resize the VM (scale up) or add more VMs (scale out).
11Which tool shows that the problem is a network delay?
Network Watcher, with Connection Monitor or Traffic Analytics.
12Which storage change helps a database with high disk latency?
Move the disk to Premium SSD.