I have the following code for obtaining a secret from the Azure key vault:
public static async Task GetToken(string authority, string resource,
If you want to authorize that same application to read secrets in your vault, run the following:
Set-AzureRmKeyVaultAccessPolicy -VaultName 'yourKeyVaultName' -ServicePrincipalName ClientId -PermissionsToSecrets Get
When you register application in Azure ClientId is generated.