Skip to content

Problem with API VideoIndexer in API-Samples/Python #166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Ange1GL opened this issue Jul 25, 2024 · 2 comments
Open

Problem with API VideoIndexer in API-Samples/Python #166

Ange1GL opened this issue Jul 25, 2024 · 2 comments

Comments

@Ange1GL
Copy link

Ange1GL commented Jul 25, 2024

Problem in the file video_indexer_api_samples.ipynb, en this line code

image

This error appears
image

Error message
image

what appears in the url of the error message

image

@kenwoodjw
Copy link

Your Application client have access permission?

@JesusColinV
Copy link

Here's a breakdown of how to fix this:

  1. Check your Azure login:

    • Local: Make sure you're logged in with the correct Azure subscription using az login. If you have multiple subscriptions, use az account set --subscription <subscription_id> to select the right one.
    • App Service/Kubernetes: Use Managed Identities if possible. Make sure the Managed Identity assigned to your service has the "Video Indexer Contributor" role (or a custom role with equivalent permissions) on the Video Indexer account.
  2. Grant permissions (RBAC): This is the core issue.

    • Azure portal: Go to your Video Indexer account -> Access Control (IAM) -> Add role assignment. Choose "Video Indexer Contributor" (or a custom role) and select your application as the principal. If you're using a Managed Identity, select the identity of your App Service/Kubernetes pod.

    • Azure CLI:

      az role assignment create --role "Video Indexer Contributor" --assignee <principal_id> --scope <video_indexer_account_resource_id>

      Replace <principal_id> with your app's Object ID (or Application ID if it's a service principal) and <video_indexer_account_resource_id> with your Video Indexer account's resource ID (found in the portal's Properties section).

  3. Check your code:

    • Connection string: Double-check the connection string/credentials in your Python code to ensure they match the application you gave permissions to.
    • Authentication: Make sure the video_indexer_api_samples.ipynb notebook's authentication (likely using an Azure authentication library) is set up correctly with the right credentials or Managed Identity.

Let me know if you still run into trouble. Please share more details about your setup (how you're authenticating, the relevant code snippet) for more specific help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants