I would like to use Cognitive Services to use the Bing Search APIs . I created a Cog Services account in Azure Portal and used the key specified in the properties in my sample application. There are 2 keys that are listed.
A few questions:
- Which of these keys is used by us?
- Do I also need to set the Ocp-Apim-Subscription-Key in the header?
- I will be able to deny access and wonder if there is anything else that is missing when setting up cognitive services on Azure Portal.
- Am I confused if I should use Bing Api or Cognitive Services? Are both the same?
- Maybe someone can share a very simple example, since the one below (although very simple) does not work.
An example of a simplified code snippet to show what I'm doing:
...
string searchApiUrl = String.Format(
"https://api.cognitive.microsoft.com/bing/v5.0/news/search?q={0}&AccountKey={1}",
WebUtility.HtmlEncode("Movies"),
"MY ACCOUNT ID FROM Azure PORTAL");
HttpClient httpClient = new HttpClient();
string response1 = await httpClient.GetStringAsync(searchApiUrl);
...
source
share