Azure: Analyze Resource Usage

For any cloud, you need to keep a watch on your resource usage from security, health, and cost perspective. Azure provides multiple tools for this purpose.

Azure Monitor: helps facilitate logging and collection of logs.

Three types of logs in azure:

  • Activity logs provide a record of operations executed against a resource.
  • Diagnostic logs record change details against a resource. Diagnostic logs schema has the following required fields.
    • time
    • resource id
    • tenant id
    • operation name (format Microsoft.<providerName>/<ResourceType>/<Subtype>/<Write/Read/Delete/Action>)
  • Application logs are logs generated by an application

Log Analytics: this is a log search and analytics tool that collects logs from various sources and correlates the data.

Alerting: Azure monitor provides support for alerting. There are two types of alerts – Metric Alert (e.g. CPU, Memory, disk, and network usage) and Log Alerts

Alert has three parts- Target (Resource), Criteria (Logic or Condition), and Action (Action Group)

Action Group is a reusable set of notifications, such as email, voice call, message, or push to an application such as creating a ticket.

Azure Advisor: Azure has some built-in algorithms to help identify cost savings. The advisor makes recommendations on the last 14 days and targets low utilization systems.

Monitoring cost: One way to monitor cost is by resource tagging. This helps view cost based on a tag. Tags can be enforced via Azure policies.

Azure Cost Management: A reporting tool for helping to analyze and understand Azure spending. You can apply a budget and generate alerts to monitor the spend.