← Back to Dashboard

Design 28: Cost Management (Budgets)

Summary

This design implements Cost Management to prevent billing shock.

Topology: Budgets are applied at the Subscription level. They monitor all Hub and Spoke spending.

1. Key Design Decisions (ADR)

ADR-01: Budget Scope

  • Decision: Subscription Level.
  • Rationale: Catch total spending. You can also set granular budgets per Resource Group.

ADR-02: Alerting

  • Decision: Email + Action Group.
  • Rationale: Notify Admins at 50%, 80%, and 100% of budget.

2. High-Level Design (HLD)

+---------------------------------------------------------+
|  Subscription: Production                               |
|  (Budget: $1000/month)                                  |
|                                                         |
|   +-----------------------+   +-----------------------+ |
|   | Hub VNet Resources    |   | Spoke VNet Resources  | |
|   | ($200)                |   | ($500)                | |
|   +-----------------------+   +-----------------------+ |
|                                                         |
|               Total: $700 (70%)                         |
+---------------------------|-----------------------------+
                            |
                            v
                    +----------------+
                    | Cost Management|
                    | (Alert Trigger)|
                    +-------|--------+
                            |
                            v
                    +----------------+
                    | Email Admin    |
                    | "Budget 70%!"  |
                    +----------------+

3. Low-Level Design (LLD)

+-----------------------------------------------------------------------+
| Budget Object: budget-prod-monthly                                    |
| Amount: $1000                                                         |
| TimeGrain: Monthly                                                    |
| StartDate: 2023-01-01                                                 |
+-----------------------------------|-----------------------------------+
                                    |
                                    v
+-----------------------------------|-----------------------------------+
| Action Group: ag-finance-team                                         |
| - Email: finance@contoso.com                                          |
| - SMS: +1-555-0199                                                    |
| - Webhook: (Optional - Trigger Logic App to shutdown VMs)             |
+-----------------------------------------------------------------------+

4. Component Rationale

  • Cost Analysis: The dashboard where you slice and dice costs by Tag (e.g., CostCenter: IT).

5. Strategy: High Availability (HA)

  • N/A.

6. Strategy: Disaster Recovery (DR)

  • N/A.

7. Strategy: Backup

  • Exports: Configure "Continuous Export" of cost data to a Storage Account (CSV) for archival.

8. Strategy: Security

  • RBAC: Only Cost Management Contributor can edit budgets. Reader can view.

9. Well-Architected Framework Analysis

  • Reliability: N/A.
  • Security: N/A.
  • Cost Optimization: Excellent. The core tool for this pillar.
  • Operational Excellence: High. Automated alerts.
  • Performance Efficiency: N/A.

10. Detailed Traffic Flow

1. Spend: VM runs for 1 hour. Meter emits usage event.

2. Process: Azure billing engine processes usage (approx 4-24 hour delay).

3. Evaluate: Cost Management checks total vs Budget.

4. Trigger: Total > $500 (50%).

5. Action: Sends email to Admin.

11. Runbook: Deployment Guide (Azure Portal)

11. Runbook: Deployment Guide (Azure Portal)

Phase 1: Create Action Group

1. Search: "Monitor" -> Alerts.

2. Action groups (Top menu) -> + Create.

3. Resource group: rg-monitor.

4. Action group name: ag-finance-team.

5. Notifications:

* Notification type: Email/SMS message/Push/Voice.

* Name: EmailAdmin.

* Email: Check the box and enter admin@contoso.com.

6. Review + create -> Create.

Phase 2: Create Budget

1. Search: "Cost Management + Billing".

2. Select your Subscription (e.g., Azure Subscription 1).

3. Cost Management (Left Menu) -> Budgets.

4. + Add.

5. Budget details:

* Name: Monthly-Prod-Limit.

* Reset period: Billing month or Calendar month.

* Creation date: Today.

* Expiration date: 2 years later.

* Amount: 1000 (Enter your monthly limit in your currency).

6. Next.

7. Set alerts:

* Type: Actual.

* % of budget: 50 (Alert at $500).

* Action group: Select ag-finance-team.

* Add another alert:

* Type: Actual.

* % of budget: 80.

* Action group: ag-finance-team.

* Add another alert:

* Type: Actual.

* % of budget: 100.

* Action group: ag-finance-team.

8. Create.

Phase 3: Verify

1. You will see the budget Monthly-Prod-Limit in the list.

2. Wait 24 hours for spending data to populate.

3. Check your email. You will receive a "Budget created" confirmation.

4. *Note: Cost data is not real-time. It has a 4-24 hour latency.*

Phase 3: Verify

1. You will see the budget listed.

2. Wait 24 hours for spending data to populate against the budget graph.