You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"code":"401","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."}
The instructions don't say anything about setting an endpoint, but I tried that too, setting the Endpoint property from the one in my Keys and Endpoint page:
I was able to get it working by calling the REST api directly, so I know the key isn't the issue. For now I'm calling the REST API but it's a pretty kludgy API to call so I'd much prefer to use the SDK, especially since I can't get the REST code working when uploading an image instead of providing a URL: https://github.com/microsoft/bing-search-dotnet-samples/issues/4
Anyone have any idea what's going on? I tried both keys with no success. Here's a LINQPad repro of the issue: http://share.linqpad.net/c3p8vo.linq
The text was updated successfully, but these errors were encountered:
I figured out the issue. The nuget SDK pointed to by the documentation is incorrect! It says to use the Microsoft.Azure.CognitiveServices.Search.VisualSearch package which is out-of-date, and has the old endpoint in it: https://api.cognitive.microsoft.com. I found that there's another SDK in nuget, Microsoft.Bing.Search.VisualSearch which has the correct endpoint: https://api.bing.microsoft.com, but I can't find documentation anywhere pointing to that! That's pretty dang bad.
I feel I must be missing something obvious here. I've been trying to follow the instructions at https://docs.microsoft.com/en-us/bing/search-apis/bing-visual-search/quickstarts/sdk/visual-search-client-library-csharp. I created a "Bing Search" service in Azure with the S9 tier which supports Visual Search. I went to the Keys and Endpoint section and copied the Key 1 out and put it in the below code, yet every time I run it I get
Unauthorized
:The instructions don't say anything about setting an endpoint, but I tried that too, setting the Endpoint property from the one in my Keys and Endpoint page:
client.Endpoint = "https://api.bing.microsoft.com/";
But that just result in a
NotFound
error.I was able to get it working by calling the REST api directly, so I know the key isn't the issue. For now I'm calling the REST API but it's a pretty kludgy API to call so I'd much prefer to use the SDK, especially since I can't get the REST code working when uploading an image instead of providing a URL: https://github.com/microsoft/bing-search-dotnet-samples/issues/4
Anyone have any idea what's going on? I tried both keys with no success. Here's a LINQPad repro of the issue: http://share.linqpad.net/c3p8vo.linq
The text was updated successfully, but these errors were encountered: