I have an application which retrieves videos from confluence, then uses Azure Video Indexer to get the transcript and then put the content into an internal database for RAG using an LLM.
When it comes for Azure Video Indexer there two ways to analyze the video and get the transcript, either using a trial account, either using a paid account. Both they need a token which is expiring every one hour. Given that each video takes 5-10 mins to process we are going to need many tokens.
Trial users have limited number of hours for videos analysis so it makes sense to use only paid accounts. In order to use paid accounts and generate a token the only way is though Azure Management API.
https://management.azure.com/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.VideoIndexer/accounts/{account_name}/generateAccessToken?api-version=2025-04-01
And then using this token to another call https://api.videoindexer.ai/{location}/Accounts/{account_id}/Videos?name={video_name}
The Azure Management API uses Delegated permissions and therefore a user must have singed in on the host where the application runs.

But this does not make sense for the use-case, as the application itself should have the ability to do this without a user context.
On the other hand there is another api to generate tokens
https://api.videoindexer.ai/Auth/{location}/Accounts/{account_id}/AccessToken
And then using this token to another call
https://api.videoindexer.ai/{location}/Accounts/{account_id}/Videos?name={video_name}
This is using the subscription key from the Azure Video Indexer Portal into the headers

But this can be used only for trial accounts with the hours limitation, as when using a paid account id with this api for token generation there is the following error:
This request is not supported in Paid locations. It is supported in Video Indexer Trial only. Trace id: '26d00055-39e1-42b1-9cc1-f02d5a5c49f4
Also the tokens generated via Azure Portal on Video Indexer are valid for one hour, so there should be a way to be authenticated using an app and generate tokens programatically

Other articles: https://learn.microsoft.com/en-us/answers/questions/2179725/getting-issue-while-generating-access-token-for-ai?page=1&orderby=Helpful&comment=answer-1935651&translated=false#newest-answer-comment