HI, first why are you trying to use the v2 API exactly? If you are new to the platform, definitely start with the v3 API - unless there is some specific feature you needed in v2? If so, please clarify.
For the issue you note above, did you create the service principal in the API Access blade under the Media Services account in the portal, or did you do it outside of the portal? Does it show up under the Media Services account Access Control (IAM) correctly?
If so, then I suggest that you file a support ticket through the Azure portal on the account and they can assist and determine if there is an issue. Make sure to note which API, client SDK you are hitting when getting that error message.
Recommend also testing using the v3 API with the same service principal client id and secret to confirm it is working for you.