question

ObakengRebaone-8935 avatar image
0 Votes"
ObakengRebaone-8935 asked romungi-MSFT answered

Bing search v7 401 client error:permission denied

Created a trial Azure account and added a Bing Search v7 resource.

Followed https://docs.microsoft.com/en-us/azure/cognitive-services/bing-web-search/quickstarts/client-libraries?pivots=programming-language-csharp

While using Microsoft.Azure.CognitiveServices.Search.WebSearch on my client (web app) to hit the API, I get Unauthorized errors although I'm using the keys provided from the portal.

Exact error:401 Client Error: PermissionDenied for url: https://api.cognitive.microsoft.com/bing/v7.0/search?q=python&textDecorations=True&textFormat=+HTML

azure-cognitive-services
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

romungi-MSFT avatar image
0 Votes"
romungi-MSFT answered

@ObakengRebaone-8935 If you have created a new bing resource to use then the SDK client as per cognitive services documentation above will not work. Bing search has migrated from cognitive services and you need to use the REST API with your resource credentials to hit the search API. All quickstarts are available here with the correct endpoint https://api.bing.microsoft.com/v7.0/search and keys. I hope this helps.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.