How to implment Subscription Key in client and api?

Amir Saleem 41 Reputation points
2021-01-08T14:07:07.25+00:00

I am trying things out on Azure. I have already created and hosted a webapi and also a client application.
Now for the security purpose I have enabled the Subscription Key in the Webapi from api management tool in azure. Now, what changes would I need to make in the Client application so my client application can have successful communication with api.

54789-image.png

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,844 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,601 Reputation points Microsoft Employee
    2021-01-11T05:37:17.767+00:00

    Any client sending requests to APIM could either add

    1. A Ocp-Apim-Subscription-Key Header with a valid subscription key
    2. A subscription-key query params with a valid subscription key

    You could acquire a subscription key from the developer portal or azure portal. You can read more about subscriptions in the docs.