The Azure Cost Optimization Reporting Tool (ACORT) is a free, open-source tool designed to improve the cost efficiency of your Azure deployments. It performs a multi-subscription assessment of your Azure resources against Microsoft's cost optimization best practices defined in the Well-Architected Framework and Cloud Adoption Framework. A recurring email report is generated containing optimizations for each subscription with associated cost data pulled from the previous month.
- Assess your Azure workloads against 32 Microsoft cost optimization best practices scoped to subscriptions, management groups, or the entire tenant.
- Get an efficiency score for each subscription and total cost optimization potential ($).
- Receive a recurring (weekly or monthly) email report.
- Leverage cost data to understand optimization potential and determine remediation priority.
- Incorporates all Azure Advisor recommendations.
- Imports all Azure Advisor recommendations (reserved instances, VM SKU size etc.)
- Unattached Public IP adresses
- Uattached Managed Disks
- VMs deallocated for more than 90 days
- Snapshots older than 1 year
- Empty Availability Sets
- Unattached Network Interfaces
- Unattached Network Security Groups
- Empty Load Balancers
- Sentinel Workspaces with a retention period configured beyond free period (> 90 days)
- Sentinel Workspaces not using an optimal commitment tier based on average daily data ingestion
- Log Analytics Workspaces with a retention period configured beyond free period (> 31 days)
- Log Analytics Workspaces not using an optimal commitment tier based on average daily data ingestion
- Log Analytics workspaces using legacy Per-Node pricing tier
- Windows VMs without Hybrid Benefit
- Windows VM Scale Sets without Hybrid Benefit
- SQL Databases not using Hybrid Benefit
- SQL Managed Instances not using Hybrid Benefit
- Red Hat Enterprise Linux VMs not using Hybrid Benefit
- SUSE Linux Enterprise Server VMs not using Hybrid Benefit
- No use of Dev/Test subscription offer
- VMs in Dev/Test subscriptions without an autoshutdown schedule
- Recovery Services Vaults in Dev/Test subscriptions using Geo-Redundant Storage (GRS)
- Premium SKU Managed Disks in Dev/Test subscriptions
- Premium SKU Storage Accounts in Dev/Test subscriptions
- Storage Accounts using Zone-Redundant Storage in Dev/Test Subscriptions
- Storage Accounts using Geo-Redundant Storage in Dev/Test Subscriptions
- Storage Accounts using Geo-Zone-Redundant Storage in Dev/Test Subscriptions
- Storage Accounts using Read-Access Geo-Redundant Storage in Dev/Test Subscriptions
- Storage Accounts using Read-Access Geo-Zone-Redundant Storage in Dev/Test Subscriptions
- VMs in 'Stopped' power state
- Legacy v1 Storage Accounts
- Storage Accounts without data lifecycle management rules
- A user with the
Contributor
role on a subscription to deploy the resources. - A user with a mailbox to send the email report.
- A user with
User Access Administrator
orOwner
on the subscriptions or management groups to be included in the assessment.
Video deployment guide (YouTube)
- Open the Azure Portal and open a Cloud Shell (PowerShell). If this is your first time using Cloud Shell, it may require set up.
- Run
git clone https://github.com/MarcSteene/AzureCostOptimizationReportingTool.git azurecostoptimizationreportingtool
- Run
cd ./azurecostoptimizationreportingtool/
- Run
code config.txt
- Update the configuration as required:
Subscription Name
: The subscription to deploy the tool's resources to.Resource Group Name
: The name of the Resource Group to deploy the tool's resources to.Logic App Name
: The name of the Logic App used to send the email report.Automation Account Name
: The name of the Automation Account used by the tool.Deployment Location
: The display name of the location to deploy the tool's resources to.Report Frequency
: The report distribution frequency. Supports Weekly or Monthly.Mail Recipients
: The individuals to receive the reports. Use ; as the delimiter between recipients.
- Save (Control+S) and close (Control+Q) the editor.
- Run
./Deploy-AzureCostOptimizationReportingTool.ps1
and wait for deployment to complete.- If any errors occur during deployment the script will terminate. Resolve the error and run the script again. It may be necessary to delete the Resource Group and any resources created.
- Navigate to the created Resource Group and select the
office365
API connection resource. - In the list menu, select
Edit API Connection
and then select theAuthorize
button. - Authenticate as the user whose mailbox you wish to use to distribute the reports and then select
Save
. - Assign the
Reader
role to the Automation Account's Managed Identity on any management groups and subscriptions you wish to be assessed. To assess all subscriptions in the tenant, assign theReader
role to the Tenant Root Management Group. Go to your selected scope(s) and go to theAccess Control (IAM)
item. SelectAdd
then selectAdd role assignment
. - Select the
Reader
role and selectNext
. - Select the
Managed Identity
radio button then select+ Select members
. A flyout window will appear on the right side of the screen. - In the Subscription dropdown, select the subscription you deployed the tool to. In the Managed Identity dropdown, select Automation Account under System-assigned managed identity. Select the managed identity associated with the tool's Automation Account. Select the
Select
button, and thenReview + assign
. - Once the
Reader
role has been assigned to the desired assessment scopes, navigate to theACORT-Main
runbook and selectStart
. - This will trigger a manual report generation. After a few minutes the configured receipients should receive the report attachment via email. For large environments with many subscriptions this could take up to an hour.
- If the email report is not received, refer to the troubleshooting steps below.
- Navigate to the deployed Automation Account.
- Select
Jobs
from the list. - Select the
ACORT-Main
job from the list. - Select
All logs
and review the output. Resolve any errors. - If all looks well in the main job output, return to the Jobs list.
- Review all
ACORT-ProcessSubscriptions
job logs (there may be multiple worker jobs if you have multiple subscriptions) and resolve any errors.
The Azure Cost Optimization Reporting Tool is not supported under any Microsoft standard support program or service. It is provided AS IS without warranty of any kind. The entire risk arising out of the use or performance of the script and documentation remains with you.