Hello,
Thank you for posting in Microsoft Q&A.
Based on the description, I understand your question is related to Set-CsPhoneNumberAssignment from a powershell function app in Azure.
You can use an Application Registration in Azure AD (Entra) with the necessary permissions. The TeamsTelephoneNumber.ReadWrite.All permission is required for assigning telephone numbers via the Graph API, which allows the application to manage telephone numbers without needing a physical Teams admin user.
Also, I found a similar post here:
Ensure that the user logged into MicrosoftTeams has the teams administrator or global administrator role.
Have a nice day.
Best Regards,
Molly
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it