Unable to access my media services rest v2 endpoint with token generated from AAD auth

ashutoshvijaysingh101 1 Reputation point
2020-10-08T12:51:43.53+00:00

I created a service principal with owner access. Generated a token and tried to list the Assets through v2 media rest endpoint but I am getting 401 without any error in the body
Followed the complete procedure.

Azure Media Services
Azure Media Services
A group of Azure services that includes encoding, format conversion, on-demand streaming, content protection, and live streaming services.
308 questions
{count} votes

2 answers

Sort by: Most helpful
  1. John Deutscher 241 Reputation points
    2020-10-08T16:26:32.643+00:00

    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.


  2. John Deutscher 241 Reputation points
    2020-10-08T16:41:02.773+00:00

    I would not recommend using AMS in that way, as it is not supported going forward in the v3 API fully, and you should pay close attention to the differences in the v3 API key management and content protection features, as we will be deprecating the v2 API soon.

    Review the v2-to-v3 migration guide here - https://learn.microsoft.com/en-us/azure/media-services/latest/media-services-v2-vs-v3

    And also review the content protection features in v3 to see if it will meet your business needs first before choosing the service as your solution. If it does not fit, you may be better suited to look at a more dedicated DRM service that is more tailored to on-premises workflows.