How can I access Azure key vault in my sprint boot application? What do I need to implement in my code and what kind of permission needed in my subscription?
Getting error "Directory permission is needed for the current user to register the application. " while creating service principal.

Follow the below given steps and code to fetch and use the azure keyvault in spring boot application :
Run below command in the Azure Cloud Shell to get list of subscriptions and
az account listTo Set/select the particular Subscription:
az account set -s your\_subscription\_idCreate service principal using the below command:
az ad sp create-for-rbac --name myapp --role Contributor --scopes /subscriptions/mySubscriptionIDOutput:
References:
Refer to my github repo for the code to access and retrieve secret from Azure key vault.