Unable to access paid video indexer programmatically

Faiz ul Haque 0 Reputation points
2025-03-05T16:24:18.36+00:00

I am trying to utilize the Azure AI Video Indexer programmatically (directly from backend, without any UI or webbrowser).

My use case is:

  1. From the backend upload a a video and get the json data from video indexer.

I already tried many ways to get the azure video indexer token so that I can upload a upload, however, non of the works. here is the list:

  1. https://api-portal.videoindexer.ai/api-details#api=Operations&operation=Get-Account-Access-Token-With-PermissionI tried to use this method for the paid account (however, it's written that it's only for trial). Provided my subscription details from here: https://api-portal.videoindexer.ai/profile and it didn't work, also provided the azure subscription id also didn't work.
  2. second method I tried via creating Managed Application that actually give me the endpoints like /oauth2/v2.0/token and /oauth2/token, I tried "v2-oauth-ropc" method from this list: https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth-ropc (I can get the accessToken however, when I try to use that accessToken ad Authroization Bearer to get the azure indexer token, it says.
{
    "error": {
        "code": "AuthenticationFailed",
        "message": "Authentication failed."
    }
}

I am trying to follow this api documentation: https://learn.microsoft.com/en-us/rest/api/videoindexer/generate/access-token?view=rest-videoindexer-2025-01-01&tabs=HTTP&tryIt=true&source=docs#code-try-0

In the security section, it says

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2 Flow: implicit Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Expand table

NameDescriptionuser_impersonationimpersonate your user accounthowever, this "user_impersonation" never works for me. And remember, it's backend api calls, no browser, or user interaction is there.

Any help full azure team would be highly appreciated.

Best,

Faiz

FYI: Guys, I have tried many solution, please don't just throw the guidance URL here, probably I have tried them already.

Azure AI Video Indexer
Azure AI Video Indexer
An Azure video analytics service that uses AI to extract actionable insights from stored videos.
97 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Faiz ul Haque 0 Reputation points
    2025-03-12T15:20:11.5266667+00:00

    @Anonymous

    Not sure, but in my use case (already tried to mention in the first comment in detailed), it's very poor suggestion to use Management API token for backend processing, as Management API token expires and I didn't find a way or @Anonymous didn't mention any way to refresh it.

    And When he says: "To generate the access token using POST command and here is the sample command syntax"

    May be @Anonymous don't bother to read the document further as that POST API, needs Bearer token with user_impersonation scope. Here is link: https://learn.microsoft.com/en-us/rest/api/videoindexer/generate/access-token?view=rest-videoindexer-2024-01-01&tabs=HTTP#azure-auth

    Now, It's really waste of money to pay the support fees here just to access this kind of support.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.