Many Microsoft Graph API permissions are available to developers. The Graph works on a least permission model, so what permissions to use.
After figuring out how to convert a script from using Azure AD licensing cmdlets (due to stop working in June 2022), we move on to create a licensing report for a tenant using cmdlets from the Microsoft Graph SDK for PowerShell.
The Microsoft Graph SDK for PowerShell exists to help developers use Graph API calls from PowerShell. It works, but like anything in life, there's a right way to connect and use the SDK and a wrong way.
On June 30, 2022, Azure AD and Microsoft Online Services cmdlets will stop working for license management. The result is that you need to upgrade PowerShell scripts which use these cmdlets.