Using Power Bi to report licenses

Written by Technology Enthusiast | Aug 16, 2024 10:17:31 AM

Lets start with the challenges:


It is very difficult to get reporting on licenses on Azure and use this information to make useful decision on purchase, renewal or True-up/True-Down

If you have multi companies this becomes even more complex to manage and time consuming to get a proper report/dashboard with license data. 

Over-licensing without cleanup causing users not able to access resources. However, this may also be caused by :

  • licenses not yet available by supplier
  • new licenses deployed on the Azure portal with limited quantities thus having over assigned licenses and a new license without any assignments

  • What is needed
  • The Script
    • Get list of users
    • Get licenses
    • Change license names to simpler names
    • Export to Storage Account table and blob
    • Get disabled users
    • Export to Storage Account blob

  • Connect Power BI to the storage table
  • Work with the data
  • Build report 
  • Automate report

Prequisites

  1. Ensure Certificate is not expired in Keyvault on Azure
  2.  RUN VS CODE AS ADMIN
  3. Install Graph module
  4. Install-Module Microsoft.Graph -AllowClobber -Force
  5. Install EXO module
  6. Install-Module -Name ExchangeOnlineManagement
  7. install-module importexcel
  8.  install-module aztable
  9. Ensure AZ.tables module installed
  10. Install Az.Storage Module
  11. install-module az.Storage -Force