Azure key vault: access denied
I have the following code for obtaining a secret from the Azure key vault: public static async Task<string> GetToken(string authority, string resource, string scope) { var authContext = new AuthenticationContext(authority); ClientCredential clientCred = new ClientCredential(...); //app id, app secret AuthenticationResult result = await authContext.AcquireTokenAsync(resource, clientCred); if (result == null) throw new InvalidOperationException("Failed to obtain the JWT token"); return result.AccessToken; } public static string GetSecret(string secretName) { KeyVaultClient keyVaultClient = new