Lower Your Azure EA Payments: PowerShell
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.
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.
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 email@example.com -SMTPAuthorizedPassword password -SMTPSendToUsers firstname.lastname@example.org -AccessKey ‘e123fasdfasdfafrawesdv3’