public static string GetSystemIdentityAccessToken()
 {
     if (true == ManagedIdentitySupported && null == AADSystemIdentityAccessToken && IsAADPasswordConnStrSetup())
     {
         AADSystemIdentityAccessToken = AADUtility.GetManagedIdentityToken().GetAwaiter().GetResult();
         if (AADSystemIdentityAccessToken == null)
         {
             ManagedIdentitySupported = false;
         }
     }
     return((null != AADSystemIdentityAccessToken) ? new string(AADSystemIdentityAccessToken.ToCharArray()) : null);
 }
 public static string GetUserIdentityAccessToken()
 {
     if (true == ManagedIdentitySupported && null == AADUserIdentityAccessToken && IsAADPasswordConnStrSetup())
     {
         // Pass User Assigned Managed Identity Client Id here.
         AADUserIdentityAccessToken = AADUtility.GetManagedIdentityToken(UserManagedIdentityClientId).GetAwaiter().GetResult();
         if (AADUserIdentityAccessToken == null)
         {
             ManagedIdentitySupported = false;
         }
     }
     return((null != AADUserIdentityAccessToken) ? new string(AADUserIdentityAccessToken.ToCharArray()) : null);
 }