MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.26k stars 21.43k forks source link

HTTP 404 error on the code sample #56016

Closed ksivasenthil closed 4 years ago

ksivasenthil commented 4 years ago

Running the code sample offered in the document; I receive the following error always.

Response:
{
    "error": {
    "code": "404",
    "message": "Resource not found"
    }
}

I have added the subscription key and endpoint in environment variables. I use a local image which when read into byte array has length of 81649


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ksivasenthil commented 4 years ago

I created a trial access for the Computer Vision API. On successful addition of the API to my subscription account URL's were printed on the screen as endpoint. They are listed here -

https://westcentralus.api.cognitive.microsoft.com/vision

https://westcentralus.api.cognitive.microsoft.com/vision

https://westcentralus.api.cognitive.microsoft.com/vision

https://westcentralus.api.cognitive.microsoft.com/vision

https://westcentralus.api.cognitive.microsoft.com/vision

I do not know why there are so many of same text. But, if you notice there is already vision to the URL. I copied this entire text and set to the environment variable. In the code the environment variable is added with /vision/v3.0/read/analyze causing the 404.

So, be careful when you copy paste :D.

To avoid this silly copy and paste issue; the code in the page could change to not have the vision appended to the endpoint.

Mike-Ubezzi-MSFT commented 4 years ago

@ksivasenthil Thank you for bringing this to our attention. If you need additional assistance please do not hesitate to reach out with additional questions.

Mike-Ubezzi-MSFT commented 4 years ago

@PatrickFarley for awareness with regard to a potential doc update with this information.