public static string GetEndpointUrl(this AzureEnvironment azureEnvironment, AzureEndpoint azureEndpoint) { if (azureEnvironment is null) { throw new ArgumentNullException(nameof(azureEnvironment)); } return(azureEndpoint switch { AzureEndpoint.ResourceManagerEndpoint => azureEnvironment.ResourceManagerEndpoint, AzureEndpoint.GraphEndpoint => azureEnvironment.GraphEndpoint, _ => throw new NotSupportedException($"The Azure endpoint {azureEndpoint} is not supported.") });
public DevelopmentTokenProvider(IAzureSessionService azureSessionService, AzureEndpoint azureEndpoint) { this.azureSessionService = azureSessionService ?? throw new ArgumentNullException(nameof(azureSessionService)); this.azureEndpoint = azureEndpoint; }
public static Task <string> AcquireTokenAsync(AzureEndpoint azureEndpoint = AzureEndpoint.ResourceManagerEndpoint, IAzureSessionOptions azureSessionOptions = null, IHttpClientFactory httpClientFactory = null) => new AzureSessionService(azureSessionOptions, httpClientFactory).AcquireTokenAsync(azureEndpoint);