I am using ApplicationTokenProvider.LoginSilentAsync method in a web job but It is not returning anything and just getting terminated without throwing any exception. In the below-given code ApplicationTokenProvider.LoginSilentAsync method is not returning anything it just terminates in this method.
C#
private static async Task CreateMediaServicesClientAsync(ConfigWrapper config)
{
var credentials = await GetCredentialsAsync(config);
return new AzureMediaServicesClient(config.ArmEndpoint, credentials)
{
SubscriptionId = config.SubscriptionId,
};
}
private static async Task GetCredentialsAsync(ConfigWrapper configWrapper)
{
ClientCredential clientCredential = new ClientCredential(configWrapper.AadClientId, configWrapper.AadSecret);
ServiceClientCredentials creds = await ApplicationTokenProvider.LoginSilentAsync(configWrapper.AadTenantId, clientCredential, ActiveDirectoryServiceSettings.Azure).ConfigureAwait(false);
return creds;
}

Answers
Know the answer? Post it. Somebody with the same question will find it here.