Lesson 3 of 4 ยท Azure with Terraform
VMs and App Service
Azure virtual machines give you operating-system control. App Service provides a managed platform for web applications. Choose based on how much infrastructure control the application genuinely needs.
Example
resource "azurerm_service_plan" "main" {
name = "plan-training"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
os_type = "Linux"
sku_name = "B1"
}Step by step
- Create a service plan before an App Service.
- Use a VM when the workload needs OS-level control.
- Use managed app hosting for standard web workloads.
- Review the chosen service tier as demand changes.
Common mistakes to avoid
- Creating an App Service without a service plan.
- Selecting a production SKU without checking expected usage.