@Mayank Goyal Yes, if you are using the REST API call the key needs to be set via the header. If you are planning to use the SDK then you can set the keys as an environment variable or get the secrets from Azure key vault and pass to the computer vision client.
You can also use a custom domain to create your cognitive services resource and tie this up with a Azure Active Directory for RBAC access. This is only supported by some of the cognitive services and detailed steps to create them are available here.