Serverless and Automation for Administrators: Azure Functions, Logic Apps, Automation Accounts and Scheduled Operations

Microsoft Certified Azure Administrator Associate AZ 103 55 min min read Updated: Nov 17, 2026 Intermediate
Serverless and Automation for Administrators: Azure Functions, Logic Apps, Automation Accounts and Scheduled Operations
Intermediate Topic 3 of 3

Why Automate?

  • Remove repeated manual work and mistakes
  • Stop dev VMs at night, clean old resources, react to alerts, onboard users

Tool Choices

ToolBest for
Azure FunctionsSmall pieces of code triggered by timers, HTTP, queues, blobs and more
Logic AppsLow-code workflows with connectors (email, Teams, SharePoint, SQL)
Azure AutomationPowerShell or Python runbooks, update management and configuration
Event GridReact to Azure events, such as a resource created

Azure Functions

  • A function runs when a trigger fires (timer, HTTP, blob created, queue message)
  • Plans: Consumption or Flex Consumption (pay per execution), Premium (no cold start, VNet) and Dedicated (App Service plan)
  • Needs a storage account and optionally Application Insights
bash az storage account create -g rg-auto -n stfunc482 --sku Standard_LRS az functionapp create -g rg-auto -n func-admin-482 --storage-account stfunc482 --consumption-plan-location centralindia \ --runtime python --runtime-version 3.11 --functions-version 4 --os-type Linux --assign-identity [system]
python import logging, azure.functions as func app = func.FunctionApp() @app.timer_trigger(schedule="0 0 20 * * 1-5", arg_name="t", run_on_startup=False) # 20:00 on weekdays def stop_dev_vms(t: func.TimerRequest) -> None: logging.info("Stopping dev VMs") # use azure-mgmt-compute with DefaultAzureCredential to deallocate VMs tagged Environment=Dev

Give the function's managed identity the Virtual Machine Contributor role on the dev resource group, so it can stop VMs without secrets.

Logic Apps

  • Pick a trigger (for example: when an email arrives, when a blob is created, every day)
  • Add actions (send Teams message, create a ticket, call an API) with conditions and loops
  • Consumption (pay per run) or Standard (fixed hosting with VNet integration)

Azure Automation

  1. Create an Automation account with a system-assigned managed identity
  2. Give that identity a role (for example VM Contributor)
  3. Create a runbook (PowerShell) and test it
  4. Link a schedule to run it
powershell # Runbook: stop all VMs tagged AutoStop=true Connect-AzAccount -Identity Get-AzVM -Status | Where-Object { $_.Tags["AutoStop"] -eq "true" -and $_.PowerState -eq "VM running" } | ForEach-Object { Stop-AzVM -ResourceGroupName $_.ResourceGroupName -Name $_.Name -Force }
  • Also: Update management, State configuration, Hybrid Runbook Workers for on-premises servers
  • Simple VM auto-shutdown is also available in the VM settings

Practice

  1. Create a timer-triggered function that logs a message
  2. Build a Logic App that emails you when a blob is uploaded
  3. Create an Automation runbook that starts VMs by tag
  4. Give the identity only the role it needs

Conclusion

Use Functions for code, Logic Apps for low-code flows and Automation runbooks for admin scripts, all with managed identities and least privilege roles.

Quick Summary: why; tools; Functions; Logic Apps; Automation; practice.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators