public static async Task <IAzureMediaServicesClient> CreateMediaServicesClientAsync(AzureMediaServices config) { var credentials = await GetCredentialsAsync(config); Uri armEndPointUrl = config.ArmEndpoint != null ? new Uri(config.ArmEndpoint) : null; return(new AzureMediaServicesClient(armEndPointUrl, credentials) { SubscriptionId = config.SubscriptionId, }); }
public AppConfiguration() { AppSettings = new AppSettings(); AzureMediaServices = new AzureMediaServices(); }
private static async Task <ServiceClientCredentials> GetCredentialsAsync(AzureMediaServices config) { ClientCredential clientCredential = new ClientCredential(config.AadClientId, config.AadSecret); return(await ApplicationTokenProvider.LoginSilentAsync(config.AadTenantId, clientCredential, ActiveDirectoryServiceSettings.Azure)); }