Post

Azure | Understanding Cloud Service Models

Cloud computing service models can be complex to understand. This post uses a simple pizza-making analogy to explain different cloud service models, followed by technical implementations in Microsoft Azure.

Service Models Explained

Traditional On-Premises (Making Pizza at Home)

In this scenario, you’re responsible for everything:

  • Buying and maintaining the kitchen (infrastructure)
  • Purchasing all ingredients (software and data)
  • Following recipes (implementing solutions)
  • Cooking (operating the system)
  • Cleaning and maintenance (system maintenance)

Infrastructure as a Service (IaaS) - Take & Bake Pizza Shop

Like using a pizza shop’s kitchen:

  • The provider maintains the kitchen (infrastructure)
  • You bring your ingredients (software)
  • You make the pizza your way (complete control over applications)
  • You’re responsible for the cooking process (operation)
  • The shop handles facility maintenance (infrastructure maintenance)

Platform as a Service (PaaS) - Pizza Restaurant Kitchen Rental

Similar to having access to a ready-to-use kitchen:

  • Pre-installed equipment and basic ingredients (platform and tools)
  • Focus on making your special pizza (application development)
  • No worry about maintenance or basic supplies
  • Limited to available tools and ingredients (platform constraints)

Software as a Service (SaaS) - Ordering a Ready-Made Pizza

The complete solution:

  • Ready-to-eat pizza (fully managed application)
  • Choose from available options (configuration only)
  • No cooking required (no development needed)
  • Pay per use (subscription-based)

Function as a Service (FaaS) - Pizza Vending Machine

Specialized, event-driven service:

  • Pay only when you get a slice (consumption-based)
  • Fully automated (serverless)
  • Perfect for specific, isolated needs
  • Scales automatically

Technical Implementations

Traditional On-Premises Example

1
2
3
4
5
6
7
8
9
10
# Example of managing your own infrastructure
# Server setup
sudo apt-get update
sudo apt-get install -y nginx mysql-server
sudo systemctl start nginx
sudo systemctl enable nginx

# Firewall configuration
sudo ufw allow 'Nginx HTTP'
sudo ufw allow 'MySQL'

IaaS Example (Azure)

1
2
3
4
5
6
7
8
9
10
11
# Creating a Virtual Machine in Azure
New-AzResourceGroup -Name "MyPizzaRG" -Location "eastus"

New-AzVM `
    -ResourceGroupName "MyPizzaRG" `
    -Name "PizzaServerVM" `
    -Location "eastus" `
    -Image "UbuntuLTS" `
    -Size "Standard_DS2_v2" `
    -PublicIPAddressName "PizzaServerIP" `
    -OpenPorts 80,443

PaaS Example (Azure App Service)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Azure App Service configuration
name: pizza-ordering-service
resources:
  - type: Microsoft.Web/serverfarms
    name: pizza-service-plan
    sku:
      name: P1v2
      tier: PremiumV2
  
  - type: Microsoft.Web/sites
    name: pizza-ordering-app
    properties:
      serverFarmId: pizza-service-plan
      httpsOnly: true
      siteConfig:
        phpVersion: '7.4'
        webSocketsEnabled: true

SaaS Example (Microsoft 365 Integration)

1
2
3
4
5
6
7
8
9
10
11
12
# Microsoft 365 user management
Install-Module -Name ExchangeOnlineManagement
Connect-ExchangeOnline

# Create a new user for the pizza ordering system
New-MsolUser `
    -UserPrincipalName "orders@pizzeria.com" `
    -DisplayName "Pizza Ordering System" `
    -FirstName "Pizza" `
    -LastName "System" `
    -UsageLocation "US" `
    -LicenseAssignment "pizzeria:O365_BUSINESS_PREMIUM"

FaaS Example (Azure Function)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
public static class PizzaOrderProcessor
{
    [FunctionName("ProcessPizzaOrder")]
    public static async Task<IActionResult> Run(
        [HttpTrigger(AuthorizationLevel.Function, "post")] HttpRequest req,
        [Queue("pizza-orders")] IAsyncCollector<PizzaOrder> orderQueue,
        ILogger log)
    {
        string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
        var order = JsonConvert.DeserializeObject<PizzaOrder>(requestBody);
        
        await orderQueue.AddAsync(order);
        
        return new OkResult();
    }
}

Responsibility Matrix

Component On-Premises IaaS PaaS SaaS FaaS
Application You You You Cloud You
Data You You You Cloud You
Runtime You You Cloud Cloud Cloud
Middleware You You Cloud Cloud Cloud
OS You You Cloud Cloud Cloud
Virtualization You Cloud Cloud Cloud Cloud
Servers You Cloud Cloud Cloud Cloud
Storage You Cloud Cloud Cloud Cloud
Networking You Cloud Cloud Cloud Cloud

What next ?

Each service model offers different levels of control and responsibility. Choose the right model based on your specific needs:

  • Use IaaS when you need full control over the infrastructure
  • Choose PaaS when you want to focus on application development
  • Opt for SaaS when you need a ready-to-use solution
  • Select FaaS for event-driven, scalable microservices

Remember, like choosing between making pizza at home or ordering one, there’s no universally “best” option - it depends on your specific requirements, expertise, and resources.

This post is licensed under CC BY 4.0 by the author.