How can i access API Key of the video indexer?

Riccardo Perelli 156 Reputation points
2022-05-19T08:07:08.91+00:00

I have problem accessing my API Key of video indexer.

I go on Azure video indexer portal, in the subscription details section, in order to access my API Key, but that API Key remain linked to an old one istance of the video indexer and i can't access the new one.

So, for me remain impossible use the new video indexer instance.

203633-microsoftteams-image.png
203665-microsoftteams-image-1.png

We are using as subscription key the string you can find at https://api-portal.videoindexer.ai/profile under "Primary key" name
As account id the one available in the video indexer overview page (portal.azure.com --> video indexer instance --> overview)
As location the one specified when creating the video indexer, in our case westeurope

What can i do to resolve this problem? and what is it the cause?

Thank you :)

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.
317 questions
0 comments No comments
{count} vote

Accepted answer
  1. brtrach-MSFT 16,586 Reputation points Microsoft Employee
    2022-05-20T02:27:29.673+00:00

    @Riccardo Perelli We see that you also have opened a support case. Sharing the suggested answer from the support engineer here for you and anyone else in the community who may have the same error.

    Here is how you can identify if your account is Classic or ARM:
    203944-image.png

    For classic account, we generate access token using the API portal: https://api-portal.videoindexer.ai/api-details#api=Operations&operation=Get-Account-Access-Token

    For ARM accounts, is not possible to get the access token via API portal.
    To Get Account Access Token for ARM accounts, you can use one of the following options:

    Portal

    1. Login and go to Video Analyzer for Media account
    2. Go to Management API, choose the permission and scope.

    REST API

    1. REST API link: https://learn.microsoft.com/en-us/rest/api/videoindexer/generate/access-token
    2. Try It and Sign in with your account.

    203945-image.png
    3. Fill in with your account name, resource group name and edit the Body as you want.
    {
    permissionType: "Contributor",
    scope: "Account"
    }
    4. Click Run

    Example:
    203925-image.png

    Please let us or your support case owner know if this does not help resolve the matter so we can assist you further.


2 additional answers

Sort by: Most helpful
  1. hbrulabs_products 36 Reputation points
    2022-12-04T14:17:45.5+00:00

    Is there a way to generate the access token used in the authorization header programmatically? It's still not clear why I need an access token to get an access token. With Classic account, all I needed was to specify the APIM in the header. But with ARM, I need an bearer token to get an access token. If I were building a node.js app, how do I programmatically get this bearer token?

    Thank you

    7 people found this answer helpful.

  2. Ilyas Andossov 1 Reputation point
    2022-07-07T12:14:50.453+00:00

    For the REST API method, if you are to do it automatically and construct a HTTP call via Logic app or a function, what authentication bearer I shall use ?

    If I use the App registration it gives me this error
    {
    "error": {
    "code": "AuthorizationFailed",
    "message": "The client '---------' with object id '---------' does not have authorization to perform action 'Microsoft.VideoIndexer/accounts/generateAccessToken/action' over scope '/subscriptions/---------/resourceGroups/---------/providers/Microsoft.VideoIndexer/accounts/---------' or the scope is invalid. If access was recently granted, please refresh your credentials."
    }
    }

    I could not find that action in a standard list of app registration api permissions.

    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.