Trying to retrieve the KeyVault Secret by AD authentication using Certificate.

[Documentation Reffered for Creating KeyVault & AD application using Certificate](https://learn.microsoft.com/en-us/azure/key-vault/key-vault-use-from-web-application)

> 
> 
> ```
> public static async Task<string> GetAccessToken(string authority, string resource, string scope) {
>     var context = new AuthenticationContext(authority, TokenCache.DefaultShared);
>     var result = await context.AcquireTokenAsync(resource, AssertionCert);
>     return result.AccessToken; }
> 
> ```
> 
> 

Code fails while

> 
> var result = await context.AcquireTokenAsync(resource,AssertionCert)
> 
> 
> 

InnerException contains: "Keyset does not exists"

And some times "Invalid provider type specified." error occurs
Not sure where is the issue.