Copy the script below, paste it into a PowerShell 7 window, and run it. It will prompt you to sign in with your admin account.
Full Month Script
Runs the correct redirect for whichever day it is today — ideal for a daily scheduled task.
Webhook URL
The webhook URL contains an authentication token, so it is stored as the
WEBHOOK_URL application setting on the Static Web App and is never
delivered to the browser. Update it in
Azure Portal → Static Web App → Configuration → Application settings.
The Sync button posts to /api/sync, which checks your Entra ID sign-in
before calling Azure Automation on your behalf.
Runbook Code (On-Demand via Webhook)
1. SharePoint list IT-SUPPORT-ON-CALL-LIST on IT-Sharepoint is already created ✅
Columns used: Title (date), ShortName, ExternalNumber 2. In Settings (⚙), the SharePoint Site URL and list name are pre-filled — verify they match 3. Automation Account → Modules → Browse Gallery → import MicrosoftTeams (Runtime 7.2) 4. Enable System Assigned Managed Identity → assign Teams Administrator role in Entra ID
Also grant Sites.ReadWrite.All (Graph API) to the Managed Identity via PowerShell: $sp = Get-MgServicePrincipal -Filter "displayName eq 'YourAutomationAccountName'" $graph = Get-MgServicePrincipal -Filter "appId eq '00000003-0000-0000-c000-000000000000'" $role = $graph.AppRoles | Where { $_.Value -eq 'Sites.ReadWrite.All' } New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $sp.Id -PrincipalId $sp.Id -ResourceId $graph.Id -AppRoleId $role.Id 5.Runbooks → Create runbook (PowerShell 7.2) → paste code below → Publish 6. Runbook → Webhooks → Add webhook → copy URL → store it as the
WEBHOOK_URL application setting on the Static Web App (never in this page)
🕛 Daily Auto-Sync at 00:00
No second runbook needed! The runbook above handles both manual and scheduled runs.
1. Automation Account → Schedules → Add a schedule
• Name: Daily-OnCall-Midnight
• Start: tomorrow at 00:00, timezone: Asia/Jerusalem
• Recurrence: Recurring, every 1 Day, no expiry → Create 2. Open the runbook → Schedules → Add a schedule → link Daily-OnCall-Midnight 3. Done — each night at midnight it reads the SharePoint list and updates Teams AA automatically.
No monthly maintenance needed. Just keep the calendar updated and click Sync whenever you change it.
🔑 Sign in to Microsoft
Open the link below and enter the code
Waiting for sign-in…
⚡ Syncing Teams Call Routing
Updating AA-OncallShift-Support…
📂 Import Schedule
Date
Name in file
Matched user
📜 Version History
💾 Each snapshot contains the full schedule for all months — restoring any version will fully recover the entire project in case of data corruption.
Loading...
🗑 Deleted Notes
Deleted notes are kept here. Restore any note to bring it back.
⚡ Sync Teams Now
Send email & SMS notification to the current on-call agent?