MicrosoftDocs / azure-docs

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

Getting "ErrorResponseException: Operation returned an invalid status code 'Resource Not Found'" #66176

Closed pablodiazgutierrez closed 3 years ago

pablodiazgutierrez commented 3 years ago

I tried the sample code on a Python 3.8 setup, with freshly created credentials, and I'm getting a not found error:

Traceback (most recent call last):
  File "project.py", line 14, in <module>
    web_data = client.web.search(query="Priority Matrix")
  File "/Users/pablo/Programming/Appfluence/BingSearch/mytestenv/lib/python3.8/site-packages/azure/cognitiveservices/search/websearch/operations/_web_operations.py", line 371, in search
    raise models.ErrorResponseException(self._deserialize, response)

Is this a known error? I wonder if the endpoint has changed. I'm using https://api.bing.microsoft.com/ which is what the Azure portal gives me...


Document Details

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

YutongTie-MSFT commented 3 years ago

@pablodiazgutierrez Hello Pablo, the API endpoint is https://api.bing.microsoft.com/v7.0/search For client seems it's not. I am checking internally and will get back to you soon.

pablodiazgutierrez commented 3 years ago

Thanks for checking. I tried with that as well since I found it in some forum, with the same result.

-Pablo

From: YutongTie-MSFT notifications@github.com Date: Monday, November 16, 2020 at 8:54 PM To: MicrosoftDocs/azure-docs azure-docs@noreply.github.com Cc: Pablo Diaz-Gutierrez pablo@appfluence.com, Mention mention@noreply.github.com Subject: Re: [MicrosoftDocs/azure-docs] Getting "ErrorResponseException: Operation returned an invalid status code 'Resource Not Found'" (#66176)

@pablodiazgutierrezhttps://github.com/pablodiazgutierrez Hello Pablo, the API endpoint is https://api.bing.microsoft.com/v7.0/search For client seems it's not. I am checking internally and will get back to you soon.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/MicrosoftDocs/azure-docs/issues/66176#issuecomment-728685050, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA5GMCFZBSOYRULKI6D62JLSQH6W7ANCNFSM4TX6ANPQ.

RohitMungi-MSFT commented 3 years ago

Could you please check if your credentials are working with this endpoint directly using curl?

curl -H "Ocp-Apim-Subscription-Key: <your_key>" https://api.bing.microsoft.com/v7.0/search?q=microsoft+devices

pablodiazgutierrez commented 3 years ago

Hi Rohit,

Yes, that curl query works. But replacing the endpoint in the sample SDK code still doesn't work. I get Operation returned an invalid status code 'Resource Not Found' just as before.

YutongTie-MSFT commented 3 years ago

@aahill Hi, it seems the endpoint is not working for client. Could you please check if we need to update the document?

I will work with PG to check on this as well.

nitinme commented 3 years ago

Thanks for your dedication to our documentation. Unfortunately, at this time we have been unable to review your issue in a timely manner and we sincerely apologize for the delayed response. Though the scope of our feedback channel here on GitHub covers specific documentation fixes, we can help redirect you to the right support channel to get an answer to your question: https://feedback.azure.com/forums/932041-azure-cognitive-services?category_id=395737. Because this issue does not relate to documentation, we are closing this issue. #please-close

jarandaf commented 1 year ago

2023 and this is still an issue.

tyler-suard-parker commented 10 months ago

Same. And it does relate to the documentation, because the documentation includes demos that won't work because the SDK does not have the correct endpoint format.

tomplac commented 8 months ago

I have the same issue.

opostavnicha commented 7 months ago

Same issue.. the documentation is not accurate.

cahya-wirawan commented 7 months ago

More than 3 years later, the problem still exist. Both endpoints https://api.bing.microsoft.com/ and https://api.bing.microsoft.com/v7.0/search don't work.

wernut commented 5 months ago

Same issue, cannot get either endpoint working through the SDK.

jgore077 commented 4 months ago

I'm facing the same issue where both endpoints don't work.