Kick off your Azure Automation Journey!

Latest Comments

No comments to show.

Automate Your Azure Like a Pro: Create an Automation Account + Scheduled Runbook

Automation in Azure isn’t just a luxury — it’s a superpower. Whether you’re managing resources, rotating secrets, running reports, or cleaning up unused resources, automating these repetitive tasks frees up time and reduces human error.

In this post, we’ll show you how to:
✅ Create an Automation Account
✅ Write your first Runbook (with PowerShell)
✅ Schedule it to run automatically


🛠 Step-by-Step Guide

🔹 Step 1: Create an Automation Account

  1. Log into the Azure Portal
  2. Search for “Automation Accounts”
  3. Click “+ Create”
  4. Select your Subscription and Resource Group
  5. Choose a name (e.g., Alcaeus-AutoAccount)
  6. Select a region (close to your workload)
  7. Under Managed Identity, turn “System-assigned” ON – this is key for secure resource access
  8. Click Review + Create, then Create

🔹 Step 2: Create a PowerShell Runbook

  1. In your Automation Account, go to “Runbooks”
  2. Click “+ Create a Runbook”
  3. Give it a name (e.g., Start-MyVMs), select PowerShell, and click Create
  4. Add your script, for example (below) & Click “Publish” when ready
$vmList = @("vm-name-1", "vm-name-2")
$resourceGroup = "YourResourceGroup"

foreach ($vm in $vmList) {
Start-AzVM -Name $vm -ResourceGroupName $resourceGroup
}

🔹 Step 3: Schedule the Runbook

  1. Go to your Runbook and click “Link to Schedule”
  2. Click “+ Add a schedule”
  3. Define your schedule:
    • Name: StartVMsDaily
    • Recurrence: Daily, Weekly, Hourly, etc.
    • Time zone-aware settings
  4. Save and link it

🔐 Security Tip

Enable System-assigned Managed Identity and grant it only minimum required RBAC permissions (e.g., Virtual Machine Contributor for managing VMs).


🎯 What’s Next?

This is just the start. In the next post, we’ll walk through automating VM shutdowns, integrating email notifications, and log retention strategies.

📌 Follow us for more Azure scripting tips!

Need help building secure and scalable automation in Azure? Contact Alcaeus – your partner in reliable cloud operations.

Tags:

Comments are closed