When you test the API from the Azure portal, you might notice that you can select a subscription key that is sent with the test as in below image. This key authorizes you need to use the API as per default, the API is protected and can't be used without authorization.

There are many option available to encrypt and decrypt subscription key. You need to encrypt the subscription key and store it an encrypted form in Web.config.`
Before invoking the API you need to Decrypt it at runtime to get its actual value from within the code.
For more information Please Refer the below links:-
.Azure API Managment.
. Create an API| MS DOC.
.Creating on-premise API using Azure API management