Where to get Ocp-Apim-Subscription-Key?

Isomi Luiz da Silva 1 Reputation point
2022-10-28T22:25:25.31+00:00

255179-capturatela-28102022-192011.png

<script type="text/javascript">
$(function() {
var params = {
// Request parameters {faceListId}
};

    $.ajax({  
        url: "https://westus.cognitiveservices.azure.com/face/v1.0/facelists/MyName?" + $.param(params),  
        beforeSend: function(xhrObj){  
            // Request headers  
            xhrObj.setRequestHeader("Content-Type","application/json");  
            xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","0cad3...c8b1");  
        },  
        type: "PUT",  
        data: "https://<<my_domain>>.com.br/face/midias/minha_foto.jpg",  
    })  
    .done(function(data) {  
        alert("success");  
    })  
    .fail(function() {  
        alert("error");  
    });  
});  

</script>

I don't know if I'm getting the correct key, as there are two more keys, called KEY1 and KEY2. Anyway, how to get the correct key to work this example for creating the list and adding the faces in it?

Azure Face
Azure Face
An Azure service that provides artificial intelligence algorithms that detect, recognize, and analyze human faces in images.
150 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,354 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Matthijs van der Veer 4,376 Reputation points MVP
    2022-10-29T04:38:07.87+00:00

    After creating the Face API resource, you can find it in the following section:
    Screenshot of the Azure Portal, showing two keys

    Please be certain to make a Face API, or Cognitive Services resource. I'm mentioning this because your screenshot mentions an API Management Service.

    0 comments No comments