M365 Licensing Overview - mattnovitsch/M365 GitHub Wiki

Summary:

Prerequisites:

References:

  1. Navigate to Power Automate
  2. Click on My Flows then Import.
  3. Click Upload.
  4. Navigate where you downloaded PowerBI-AssignedLicense, PowerBI-LicenseReport, and PowerBI-assignedPlans. Select one of the files then click open.
  5. Once the Package has uploaded you will need the review process, this is required to correct the configurations of the package. Click the Action wrench to configure each area.
  6. In this example our first configuration item is the option to update or create as new, this is because my lab already has the package. This will be handy if I ever need to update it and repost for everyone to use. I'm going to create as new in this example and add the tag -demo on the resource name. Yours should be just create as new or it will probably not ask you at all. I'm clicking save to proceed.
  7. If you do not have a Azure Log Analytics connection then click create new. If you do have one, select your existing connection and click save.
  8. Skip steps 8 through 10 if you already have a connection. Click New Connection in the top of the new tab.
  9. Type Azure Log in the top right Search box and then select Azure Log Analytics Data Collector.
  10. Type in your Workspace ID and Workspace Key. (You can get your keys by following these steps: [Getting Azure Log Analytics Keys] (https://github.com/mattnovitsch/M365/wiki/Getting-Azure-Log-Analytics-Keys))
  11. Once you save the connection Navigate back to the Flow screen and hit refresh. Select Azure Log Analytics then click Save.
  12. Now that the configurations are complete, you can click import. Do this for the remaining two Flows that you downloaded from Prerequisites
  13. One all three flows are in the system, select one.
  14. Click Edit in the top middle part of the screen.
  15. Click HTTP then click Show Advanced Options.
  16. Go down Tenant, Client ID, and Secret. (If you don't know this information please refer too Register a New application. If you have the information fill it out
  17. Save the flow and the click Test to run it. This will check if for errors and validate you connections is working.
  18. Select the radio button Manually then click Test.
  19. Click Run Flow to start the job.
  20. Click Done to review the run.
  21. Hopefully you will see "Your Flow ran successfully" at the top, if not scan the flow for any recheck marks to review.
  22. Repeat the steps for the other two flows.
  23. Navigate back to your Azure Log Analytics Workspace.
  24. On the settings part of the Left side menu, select Custom Logs. You should see assignplans_CL, AssignedLicense_CL, and LicenseData_CL. If you do not see them there then it would be a good time to take a coffee break or lunch break. Check back in 15 minutes to an hour.
  25. Select Logs on the left side menu, expand Custom Logs then double click on AssignedLicense_CL. Change the Time Range to last 7 days and click run.
  26. If you get a results then lets export the query for Power BI. Select the Export button then Export to Power BI(M query).
  27. Repeat steps 25 and 26 for assignplans_CL and LicenseData_CL.
  28. Open the M365Licenses.pbit.
  29. Cancel the api.loganalytics.io sites.
  30. You will get some errors about the credentials provided, that's to be expected. Just close the refresh screen for now.
  31. Right click on the Fields to the right and select Edit Query.
  32. Click on Advance Editor and Paste in the download from AssignedLicense_CL in step 25.
  33. Repeat step 33 for assignplans and LicenseData.
  34. Click Close & Apply.
  35. Click "Sign in as different User" for the api.loganalytics.io sites and sign in with your organizational account. Click Connect to continue.
  36. Pending any errors, you should start to see something like these two pages below.