@Be The Code As you are calling the APIM service you need to pass the Ocp-Apim-Subscription-Key
header to authenticate the request.
In your code you are passing the AuthenticationHeaderValue which creates the header as below:
Authorization: SomeHeaderKey SomeHeaderValue
The right header that APIM accepts is:
Ocp-Apim-Subscription-Key : yourSubcriptionKey
You need to replace this code : httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("SomeHeaderKey", "SomeHeaderValue"); with the below code to pass the right headers.
httpClient.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "yourSubscriptionKey");