Lower Your Azure EA Payments: PowerShell

By William Lee

Nov 012016
Azure EA

If you’re like us, you want to better understand which resources in your enterprise agreement (EA) are “hot” to reduce cost. Then read on as we look at Azure EA Billing Summary with PowerShell.

The Issue with EA

We recently noticed that our EA payment had skyrocketed. We wanted to identify which subscriptions and resources were consuming the bulk of spend. While we don’t want to limit staff, we do want developers educated on the EA costs. Our first step: Find the subscriptions and resources that are abnormally high.

The Solution

We utilized a base API script that was found on Gordon Byers site. Like much with Azure, the code has changed over the past year. So, we updated the properties and added in daily, weekly, and monthly comparisons. We also added the ability to email the report for automation.

You can download the code here.

2016-10-30_23-29-39

Example1: This shows the basic details for the most current day in the report.

.\ea.ps1 -EnrollmentNumber ‘90434343’  -AccessKey ‘e123fasdfasdfafrawesdv3

Example2: If today was 10/20/2016 most likely the most current day in the report is 10/19/2016. Thus, the report would show 10/14/2016 and a detailed resource usage due to “-dailydetails” being used.

.\ea.ps1 -EnrollmentNumber ‘90434343’  -DaysToGoBack 5 -SMTPSendEmail -SMTPServer smtp.office365.com -SMTPAutherizedUser william.lee@spr.com -SMTPAuthorizedPassword password -SMTPSendToUsers william.lee@spr.com -AccessKey ‘e123fasdfasdfafrawesdv3’