C# Class Microsoft.Azure.ServiceManagemenet.Common.ProfileClient

Convenience client for azure profile and subscriptions.
Afficher le fichier Open project: Azure/azure-powershell Class Usage Examples

Méthodes publiques

Свойство Type Description
DebugLog Action
WarningLog Action

Méthodes publiques

Méthode 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
ImportPublishSettings ( string filePath, string environmentName ) : List
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

Méthode Description
CopyAccount ( AzureAccount sourceAccount, AzureAccount targetAccount ) : void
GetSubscriptionAccount ( System.Guid subscriptionId ) : AzureAccount
ListServiceManagementSubscriptions ( AzureAccount account, AzureEnvironment environment, SecureString password, ShowDialog promptBehavior, string tenants ) : IEnumerable
ListSubscriptionsFromPublishSettingsFile ( string filePath, string environment ) : List
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 ( CloudException aadEx ) : void
WriteWarningMessage ( string message ) : void

Method Details

AddAccountAndLoadSubscriptions() public méthode

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
Résultat Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount

AddOrSetAccount() public méthode

public AddOrSetAccount ( AzureAccount account ) : AzureAccount
account Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount
Résultat Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount

AddOrSetEnvironment() public méthode

public AddOrSetEnvironment ( AzureEnvironment environment ) : AzureEnvironment
environment Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment
Résultat Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment

AddOrSetSubscription() public méthode

public AddOrSetSubscription ( AzureSubscription subscription ) : AzureSubscription
subscription Microsoft.Azure.Commands.Common.Authentication.Models.AzureSubscription
Résultat Microsoft.Azure.Commands.Common.Authentication.Models.AzureSubscription

ClearAll() public méthode

public ClearAll ( ) : void
Résultat void

ClearDefaultSubscription() public méthode

public ClearDefaultSubscription ( ) : void
Résultat void

GetAccount() public méthode

public GetAccount ( string accountName ) : AzureAccount
accountName string
Résultat Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount

GetAccountOrDefault() public méthode

public GetAccountOrDefault ( string accountName ) : AzureAccount
accountName string
Résultat Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount

GetAccountOrNull() public méthode

public GetAccountOrNull ( string accountName ) : AzureAccount
accountName string
Résultat Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount

GetEnvironment() public méthode

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

GetEnvironmentOrDefault() public méthode

public GetEnvironmentOrDefault ( string name ) : AzureEnvironment
name string
Résultat Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment

GetSubscription() public méthode

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

GetSubscription() public méthode

public GetSubscription ( string name ) : AzureSubscription
name string
Résultat Microsoft.Azure.Commands.Common.Authentication.Models.AzureSubscription

ImportCertificate() public méthode

public ImportCertificate ( X509Certificate2 certificate ) : void
certificate System.Security.Cryptography.X509Certificates.X509Certificate2
Résultat void

ImportPublishSettings() public méthode

public ImportPublishSettings ( string filePath, string environmentName ) : List
filePath string
environmentName string
Résultat List

InitializeProfile() public méthode

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).
Résultat void

InitializeProfile() public méthode

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).
Résultat void

InitializeProfile() public méthode

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).
Résultat void

ListAccounts() public méthode

public ListAccounts ( string accountName ) : IEnumerable
accountName string
Résultat IEnumerable

ListEnvironments() public méthode

public ListEnvironments ( string name ) : List
name string
Résultat List

ListSubscriptionAccounts() public méthode

public ListSubscriptionAccounts ( System.Guid subscriptionId ) : List
subscriptionId System.Guid
Résultat List

ProfileClient() public méthode

public ProfileClient ( AzureSMProfile profile ) : Hyak.Common
profile Microsoft.Azure.Commands.Common.Authentication.Models.AzureSMProfile
Résultat Hyak.Common

RefreshSubscriptions() public méthode

public RefreshSubscriptions ( AzureEnvironment environment ) : List
environment Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment
Résultat List

RemoveAccount() public méthode

public RemoveAccount ( string accountId ) : AzureAccount
accountId string
Résultat Microsoft.Azure.Commands.Common.Authentication.Models.AzureAccount

RemoveEnvironment() public méthode

public RemoveEnvironment ( string name ) : AzureEnvironment
name string
Résultat Microsoft.Azure.Commands.Common.Authentication.Models.AzureEnvironment

RemoveSubscription() public méthode

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

RemoveSubscription() public méthode

public RemoveSubscription ( string name ) : AzureSubscription
name string
Résultat Microsoft.Azure.Commands.Common.Authentication.Models.AzureSubscription

SetSubscriptionAsDefault() public méthode

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

SetSubscriptionAsDefault() public méthode

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

Property Details

DebugLog public_oe property

public Action DebugLog
Résultat Action

WarningLog public_oe property

public Action WarningLog
Résultat Action