Ejemplo n.º 1
0
        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.")
            });
Ejemplo n.º 2
0
 public DevelopmentTokenProvider(IAzureSessionService azureSessionService, AzureEndpoint azureEndpoint)
 {
     this.azureSessionService = azureSessionService ?? throw new ArgumentNullException(nameof(azureSessionService));
     this.azureEndpoint       = azureEndpoint;
 }
Ejemplo n.º 3
0
 public static Task <string> AcquireTokenAsync(AzureEndpoint azureEndpoint = AzureEndpoint.ResourceManagerEndpoint, IAzureSessionOptions azureSessionOptions = null, IHttpClientFactory httpClientFactory = null)
 => new AzureSessionService(azureSessionOptions, httpClientFactory).AcquireTokenAsync(azureEndpoint);