C# Class Microsoft.WindowsAzure.Commands.ScenarioTest.ProfileClient

Convenience client for azure profile and subscriptions.
Datei anzeigen Open project: Azure/azure-powershell Class Usage Examples

Public Properties

Property Type Description
DebugLog Action
WarningLog Action

Public Methods

Method Description
AddAccountAndLoadSubscriptions ( AzureAccount account, AzureEnvironment environment, SecureString password ) : AzureAccount
AddOrSetAccount ( AzureAccount account ) : AzureAccount
AddOrSetEnvironment ( AzureEnvironment environment ) : AzureEnvironment
AddOrSetSubscription ( AzureSubscription subscription ) : AzureSubscription
ClearAll ( ) : void
ClearDefaultSubscription ( ) : void
GetAccount ( string accountName ) : AzureAccount
GetAccountOrDefault ( string accountName ) : AzureAccount
GetAccountOrNull ( string accountName ) : AzureAccount
GetEnvironment ( string name, string serviceEndpoint, string resourceEndpoint ) : AzureEnvironment
GetEnvironmentOrDefault ( string name ) : AzureEnvironment
GetSubscription ( System.Guid id ) : AzureSubscription
GetSubscription ( string name ) : AzureSubscription
ImportCertificate ( X509Certificate2 certificate ) : void
InitializeProfile ( AzureEnvironment environment, System.Guid subscriptionId, AzureAccount account, SecureString password, string storageAccount ) : void

Initializes AzureSMProfile using passed in account and optional password.

InitializeProfile ( AzureEnvironment environment, System.Guid subscriptionId, X509Certificate2 certificate, string storageAccount ) : void

Initializes AzureSMProfile using passed in certificate. The certificate is imported into a certificate store.

InitializeProfile ( AzureEnvironment environment, System.Guid subscriptionId, string accessToken, string accountId, string storageAccount ) : void

Initializes AzureSMProfile using passed in access token.

ListAccounts ( string accountName ) : IEnumerable
ListEnvironments ( string name ) : List
ListSubscriptionAccounts ( System.Guid subscriptionId ) : List
ProfileClient ( AzureSMProfile profile ) : Hyak.Common
RefreshSubscriptions ( AzureEnvironment environment ) : List
RemoveAccount ( string accountId ) : AzureAccount
RemoveEnvironment ( string name ) : AzureEnvironment
RemoveSubscription ( System.Guid id ) : AzureSubscription
RemoveSubscription ( string name ) : AzureSubscription
SetSubscriptionAsDefault ( System.Guid id, string accountName ) : AzureSubscription
SetSubscriptionAsDefault ( string name, string accountName ) : AzureSubscription

Private Methods

Method Description
CopyAccount ( AzureAccount sourceAccount, AzureAccount targetAccount ) : void
GetSubscriptionAccount ( System.Guid subscriptionId ) : AzureAccount
ListServiceManagementSubscriptions ( AzureAccount account, AzureEnvironment environment, SecureString password, ShowDialog promptBehavior, string tenants ) : IEnumerable
ListSubscriptionsFromServer ( AzureAccount account, AzureEnvironment environment, SecureString password, ShowDialog promptBehavior ) : IEnumerable
ListSubscriptionsFromServerForAllAccounts ( AzureEnvironment environment ) : IEnumerable
LoadAccountTenants ( AzureAccount account, AzureEnvironment environment, SecureString password, ShowDialog promptBehavior ) : string[]
MergeAccountProperties ( AzureAccount account1, AzureAccount account2 ) : AzureAccount
MergeEnvironmentProperties ( AzureEnvironment environment1, AzureEnvironment environment2 ) : AzureEnvironment
MergeSubscriptionProperties ( AzureSubscription subscription1, AzureSubscription subscription2 ) : AzureSubscription
UpgradeProfile ( ) : void
WriteDebugMessage ( string message ) : void
WriteOrThrowAadExceptionMessage ( AadAuthenticationException aadEx ) : void
WriteOrThrowAadExceptionMessage ( Microsoft.Azure.CloudException aadEx ) : void
WriteWarningMessage ( string message ) : void

Method Details

AddAccountAndLoadSubscriptions() public method

public AddAccountAndLoadSubscriptions ( AzureAccount account, AzureEnvironment environment, SecureString password ) : AzureAccount
account Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount
environment Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment
password System.Security.SecureString
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount

AddOrSetAccount() public method

public AddOrSetAccount ( AzureAccount account ) : AzureAccount
account Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount

AddOrSetEnvironment() public method

public AddOrSetEnvironment ( AzureEnvironment environment ) : AzureEnvironment
environment Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment

AddOrSetSubscription() public method

public AddOrSetSubscription ( AzureSubscription subscription ) : AzureSubscription
subscription Microsoft.Azure.Commands.Common.Authentication.Models.AzureSubscription
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureSubscription

ClearAll() public method

public ClearAll ( ) : void
return void

ClearDefaultSubscription() public method

public ClearDefaultSubscription ( ) : void
return void

GetAccount() public method

public GetAccount ( string accountName ) : AzureAccount
accountName string
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount

GetAccountOrDefault() public method

public GetAccountOrDefault ( string accountName ) : AzureAccount
accountName string
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount

GetAccountOrNull() public method

public GetAccountOrNull ( string accountName ) : AzureAccount
accountName string
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount

GetEnvironment() public method

public GetEnvironment ( string name, string serviceEndpoint, string resourceEndpoint ) : AzureEnvironment
name string
serviceEndpoint string
resourceEndpoint string
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment

GetEnvironmentOrDefault() public method

public GetEnvironmentOrDefault ( string name ) : AzureEnvironment
name string
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment

GetSubscription() public method

public GetSubscription ( System.Guid id ) : AzureSubscription
id System.Guid
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureSubscription

GetSubscription() public method

public GetSubscription ( string name ) : AzureSubscription
name string
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureSubscription

ImportCertificate() public method

public ImportCertificate ( X509Certificate2 certificate ) : void
certificate System.Security.Cryptography.X509Certificates.X509Certificate2
return void

InitializeProfile() public method

Initializes AzureSMProfile using passed in account and optional password.
public InitializeProfile ( AzureEnvironment environment, System.Guid subscriptionId, AzureAccount account, SecureString password, string storageAccount ) : void
environment Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment Environment object.
subscriptionId System.Guid Subscription Id
account Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount Azure account with AD username and tenant.
password System.Security.SecureString AD password (optional).
storageAccount string Storage account name (optional).
return void

InitializeProfile() public method

Initializes AzureSMProfile using passed in certificate. The certificate is imported into a certificate store.
public InitializeProfile ( AzureEnvironment environment, System.Guid subscriptionId, X509Certificate2 certificate, string storageAccount ) : void
environment Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment Environment object.
subscriptionId System.Guid Subscription Id
certificate System.Security.Cryptography.X509Certificates.X509Certificate2 Certificate to use with profile.
storageAccount string Storage account name (optional).
return void

InitializeProfile() public method

Initializes AzureSMProfile using passed in access token.
public InitializeProfile ( AzureEnvironment environment, System.Guid subscriptionId, string accessToken, string accountId, string storageAccount ) : void
environment Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment Environment object.
subscriptionId System.Guid Subscription Id
accessToken string AccessToken to use with profile.
accountId string AccountId for the new account.
storageAccount string Storage account name (optional).
return void

ListAccounts() public method

public ListAccounts ( string accountName ) : IEnumerable
accountName string
return IEnumerable

ListEnvironments() public method

public ListEnvironments ( string name ) : List
name string
return List

ListSubscriptionAccounts() public method

public ListSubscriptionAccounts ( System.Guid subscriptionId ) : List
subscriptionId System.Guid
return List

ProfileClient() public method

public ProfileClient ( AzureSMProfile profile ) : Hyak.Common
profile Microsoft.Azure.Commands.Common.Authentication.Models.AzureSMProfile
return Hyak.Common

RefreshSubscriptions() public method

public RefreshSubscriptions ( AzureEnvironment environment ) : List
environment Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment
return List

RemoveAccount() public method

public RemoveAccount ( string accountId ) : AzureAccount
accountId string
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount

RemoveEnvironment() public method

public RemoveEnvironment ( string name ) : AzureEnvironment
name string
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment

RemoveSubscription() public method

public RemoveSubscription ( System.Guid id ) : AzureSubscription
id System.Guid
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureSubscription

RemoveSubscription() public method

public RemoveSubscription ( string name ) : AzureSubscription
name string
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureSubscription

SetSubscriptionAsDefault() public method

public SetSubscriptionAsDefault ( System.Guid id, string accountName ) : AzureSubscription
id System.Guid
accountName string
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureSubscription

SetSubscriptionAsDefault() public method

public SetSubscriptionAsDefault ( string name, string accountName ) : AzureSubscription
name string
accountName string
return Microsoft.Azure.Commands.Common.Authentication.Models.AzureSubscription

Property Details

DebugLog public_oe property

public Action DebugLog
return Action

WarningLog public_oe property

public Action WarningLog
return Action