This Logic App provides automated monitoring and reporting of Azure Reservations that are:
- Expiring soon (within a configurable future window)
- Recently expired (within a configurable past window)
It runs on a scheduled basis and sends a formatted HTML email report with reservation details.
- Runs on a configurable schedule (default: weekly, Monday at 8 AM)
- Supports:
- Custom frequency (Day / Week / Month)
- Time zone
- Specific days and times
- Calls Azure Management API: GET /providers/Microsoft.Capacity/reservationOrders
- Uses Managed Identity authentication
- No credentials stored in the Logic App
Filters reservations based on:
- Expiring soon (within next X days)
- Recently expired (within last Y days)
Extracts and formats:
- Reservation ID
- Display Name
- Created Date
- Expiration Date
- Term
- Status
- Styled HTML table
- Easy-to-read format
- Includes reservation summary and details
---
- Uses Office 365 connector
- Sends to configured recipients
- Subject is customizable
Recurrence Trigger
→ HTTP Call (Azure Reservations API)
→ Parse JSON
→ Filter Expiring / Expired
→ Transform Data
→ Build HTML Table
→ Send Email
- Managed Identity with reservation read access
- Office 365 connection (must be authorized after deployment)
Deploy via ARM template using PowerShell.
Re-authorize the Office 365 connection in Azure Portal.
- Proactive cost management
- Prevents missed renewals
- Automated reporting
- Reusable deployment
This Logic App acts as a lightweight FinOps automation tool for tracking Azure reservation expirations.
This guide walks through how to fully set up the Logic App:
- Create Resource Group
- Create Managed Identity
- Grant RBAC permissions
- Deploy Office 365 connection (ARM)
- Deploy Logic App (ARM)
- Configure Managed Identity in HTTP action
- Re-authorize Office 365 connection
- Test the workflow
- Azure subscription
- PowerShell with Az module installed
- Permission to:
- Create resources
- Assign RBAC roles
- Office 365 account for email sending
$subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$resourceGroup = "rg-logicapps"
$location = "eastus"
Connect-AzAccount
Set-AzContext -SubscriptionId $subscriptionId
New-AzResourceGroup -Name $resourceGroup -Location $location$miName = "mi-logicapp-reservations"
$mi = New-AzUserAssignedIdentity `
-ResourceGroupName $resourceGroup `
-Name $miName `
-Location $location
$managedIdentityResourceId = $mi.Id
$managedIdentityPrincipalId = $mi.PrincipalId
Write-Output $managedIdentityResourceId
Write-Output $managedIdentityPrincipalIdRecommended Role:
- Reservations Reader
No need to create an API connection as this time.
New-AzResourceGroupDeployment `
-ResourceGroupName $resourceGroup `
-TemplateFile ".\logicapp-reservation-alerts-arm.json" `
-TemplateParameterFile ".\logicapp-reservation-alerts-arm.parameters.json"- Open Logic App Designer
- Select HTTP action
- Authentication → Managed Identity
- Choose your identity
---
- Go to Azure Portal → Connections
- Select office365
- Click "Fix connection"
- Click Run Trigger
- Or wait for schedule
This setup provides automated monitoring of Azure reservations using secure managed identity and email notifications.