Skip to content

Part 8: Optimization & Tools

Source: John Savill's Azure Master Class v3 - Part 3: Governance
Video Timestamps: 1:51:00 - 2:11:50
AZ-104 Relevance: ⭐⭐⭐⭐ HIGH - Advisor, Resource Graph, Reservations


Cost Optimization Options

Azure Reservations

Pre-pay for resources to get significant discounts (up to 72% off).

TermDiscount
1 year~30-40% off
3 years~50-72% off

Best for: Predictable, steady-state workloads.

Available for: VMs, SQL, Cosmos DB, Storage, App Service, and more.

Azure Savings Plan

Flexible commitment-based discount (alternative to reservations).

TypeCommits To
Compute Savings Plan$/hour across compute services

Difference from Reservations:

  • Reservations: Specific SKU, specific region
  • Savings Plan: Any compute, any region (more flexible)

Azure Hybrid Benefit

Use existing Windows Server or SQL Server licenses.

LicenseSaves
Windows ServerUp to 40% on VMs
SQL ServerUp to 55% on Azure SQL

Requires Software Assurance or subscription licenses.


Azure Advisor

Free built-in advisor giving recommendations across five pillars.

Cost Recommendations

RecommendationExample
Right-size VMs"Resize D4 to D2"
Shutdown idle"VM idle for 7 days"
Use reservations"Save 40% with RI"
Delete unused"Unattached disk"

Portal → Advisor → Cost

How to Use

  1. Review recommendations regularly
  2. Click recommendation → see affected resources
  3. Apply or dismiss with reason

Deployment Stacks (Preview)

Group of resources managed as a single unit.

Traditional Deployment vs Stacks

AspectTraditional ARM/BicepDeployment Stacks
Remove from templateOrphaned in AzureAuto-deleted
PermissionsAt resource levelAt stack level
Deny settingsNoYes

Stack Features

FeatureBenefit
Deny settingsPrevent changes outside the stack
Delete behaviorControl what happens when resource removed from template
Scope protectionLock down managed resources

Delete Behaviors

SettingWhen Resource Removed from Template
DetachOrphan (keep but unmanage)
DeleteDelete resource

Resource Graph

Query engine for Azure resources at scale.

Why Resource Graph?

Traditional (ARM)Resource Graph
Query per subscriptionQuery ALL subscriptions at once
Slow for large environmentsFast indexed queries
Limited filteringFull Kusto Query Language

Query Language (KQL)

kusto
resources
| where type == "microsoft.compute/virtualmachines"
| where location == "eastus"
| project name, resourceGroup, properties.hardwareProfile.vmSize

Common Queries

QueryFinds
VMs by regionAll VMs in specific location
Unattached disksOrphaned disks
Resources by tagResources missing required tags
Public IPsResources with public exposure

Portal → Resource Graph Explorer


Change Analysis

See what changed in your resources over time.

How It Works

  1. Tracks configuration changes
  2. Shows timeline of modifications
  3. Helps troubleshoot "what changed?"

Portal → Monitor → Change Analysis

What It Shows

InfoExample
What changedNSG rule added
WhenFeb 1, 2024 3:45 PM
Whouser@domain.com
Old vs newSide-by-side diff

Troubleshooting: "App stopped working Tuesday" → Check Change Analysis for Tuesday changes.


Cloud Adoption Framework (CAF)

Microsoft's methodology for cloud adoption.

Key CAF Resources

ResourcePurpose
Landing ZonesPre-built architecture patterns
Naming conventionsStandard naming guidance
Tagging strategyTag recommendations
Governance guidePolicy/RBAC templates

URL: aka.ms/caf


Well-Architected Framework (WAF)

Design framework for building robust solutions.

Five Pillars

PillarFocus
ReliabilityResilience, recovery
SecurityProtect data, systems
Cost OptimizationManage costs
Operational ExcellenceOperations, monitoring
Performance EfficiencyScale, responsiveness

Well-Architected Review

Portal → Advisor → Well-Architected Review

Assess your workloads against WAF pillars.


Resource Visualizations

Resource Visualizer (Preview)

Portal → Resource Group → Resource visualizer

Shows graphical view of resources and their relationships:

  • VM connected to NIC connected to VNet
  • Dependencies at a glance

Topology View (Network)

Portal → Network Watcher → Topology

Network-focused visualization:

  • VNets, subnets, NICs
  • NSG attachments
  • Traffic flow

Summary: Governance Tools

ToolPurpose
Azure AdvisorRecommendations
Resource GraphQuery resources at scale
Change AnalysisTrack what changed
Deployment StacksManage resource groups as units
CAFAdoption methodology
WAFArchitecture best practices

Mental Model

Advisor = Doctor Checkup 🩺

  • Examines your environment
  • Gives recommendations by category
  • You decide which to follow

Resource Graph = Google for Azure 🔍

  • Search across ALL your resources instantly
  • Complex queries possible
  • Find needles in haystacks

Deployment Stacks = Moving Box 📦

  • Everything in the box moves together
  • Take something out of template → remove from box
  • Protects contents from outside changes

AZ-104 Exam Tips

TopicKey Point
Reservations1 or 3 year, specific SKU/region
Savings PlanFlexible, any compute, any region
Hybrid BenefitExisting licenses → Azure discount
Advisor5 pillars (Reliability, Security, Performance, Cost, OpEx)
Resource GraphKQL queries across all subscriptions
Change AnalysisTrack configuration changes
CAFAdoption methodology (Strategy → Plan → Ready → Adopt)
WAF5 pillars for architecture

Practical Exercises

Exercise 1: Review Azure Advisor (5 min)

  1. Portal → Advisor
  2. Check each category (Cost, Security, etc.)
  3. Click into a recommendation
  4. Review the affected resources

Exercise 2: Query with Resource Graph (5 min)

  1. Portal → Resource Graph Explorer
  2. Run: resources | where type == "microsoft.compute/virtualmachines"
  3. Try: resources | summarize count() by type
  4. Explore the available tables

Exercise 3: View Change Analysis (5 min)

  1. Portal → MonitorChange Analysis
  2. Select a resource
  3. Review recent changes
  4. Note the timeline and diff view

Exercise 4: Explore CAF (Optional)

  1. Visit aka.ms/caf
  2. Review the Landing Zone options
  3. Check the naming convention guidance

Governance Module Complete! 🎉

You've now covered:

PartTopic
1Governance Fundamentals
2Organizational Hierarchy
3Naming, Tagging & Inheritance
4Locks & ARM Resource Structure
5RBAC & ABAC
6Azure Policy
7Cost Management & Budgets
8Optimization & Tools

Next Steps:

  • Review each section's AZ-104 tips
  • Complete the practical exercises
  • Move to the next video in the Master Class series

End of Part 8 - Governance Complete

Released under the MIT License.