How do I resolve error 401?

wqe233 1 Reputation point
2024-06-11T05:03:57.5066667+00:00

I'm trying to use Azure Computer Vision service to make a call for the API through this program

However I'm getting the error message "Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource."

This is confusing because I'm pretty sure that I'm using a valid subscription key and the right API endpoint for this service, as shown from image 1 and image 2

The troubleshoot page for this error isn't providing any helpful details either.

Is there anything I may be missing to resolve this issue?

__

Edit: Somehow, this was resolved on its own after waiting some time and it started working now. Are there explanations for why it was able to resolve itself now and not before?

Azure Computer Vision
Azure Computer Vision
An Azure artificial intelligence service that analyzes content in images and video.
379 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sander van de Velde | MVP 32,736 Reputation points MVP
    2024-06-11T07:13:22.5666667+00:00

    Hello

    welcome to this moderated Azure community forum.

    Because you are referencing a GitHub repo, you can get in contact with the owner of that repo directly by submitting an issue.

    Just go to the Issues tab page and submit a new issue:

    User's image

    A 401 error is telling you access is denied. Please double-check eg. the API keys first.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.

    0 comments No comments

  2. romungi-MSFT 46,746 Reputation points Microsoft Employee
    2024-06-11T15:10:16.9+00:00

    @wqe233 After provisioning a resource the keys should be available for use immediately. Did you use the keys and endpoint from the Keys and Endpoints blade of your resource?Since you have used subscription id as seen in image1, I think the error was thrown. You should use the keys and endpoints from this tab or blade of your resource.

    User's image

    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.