3👍
✅
Initialize the library, before calling other methods, as per the documentation:
microsoftTeams.initialize()
This of course only works when running in a Teams app (tab or personal)
Source:stackexchange.com