AddAccount() public method

public AddAccount ( ITokenProvider tokenProvider ) : IEnumerable
tokenProvider ITokenProvider
return IEnumerable
Beispiel #1
0
        /// <summary>
        /// Log in to the given environment, and download and add subscriptions
        /// for the given account in that environment.
        /// </summary>
        /// <param name="environment">environment that the subscription is in.</param>
        public string AddAccounts(WindowsAzureEnvironment environment)
        {
            environment = environment ?? CurrentEnvironment;
            var newSubscriptions = environment.AddAccount(TokenProvider).ToList();

            AddSubscriptions(newSubscriptions);
            Save();
            return(newSubscriptions[0].ActiveDirectoryUserId);
        }
 /// <summary>
 /// Log in to the given environment, and download and add subscriptions
 /// for the given account in that environment.
 /// </summary>
 /// <param name="environment">environment that the subscription is in.</param>
 /// <param name="credential">optional credentials</param>
 public string AddAccounts(WindowsAzureEnvironment environment, PSCredential credential)
 {
     environment = environment ?? CurrentEnvironment;
     var newSubscriptions = environment.AddAccount(TokenProvider, credential).ToList();
     AddSubscriptions(newSubscriptions);
     Save();
     return newSubscriptions[0].ActiveDirectoryUserId;
 }