Compartilhar via


AzureRmProfile Class

Definition

Represents Azure Resource Manager profile structure with default context, environments and token cache.

[System.Serializable]
public class AzureRmProfile : IDisposable, Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer, Microsoft.Azure.Commands.Common.Authentication.ResourceManager.IProfileOperations
[System.Serializable]
public class AzureRmProfile : IDisposable, Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer, Microsoft.Azure.Commands.Common.Authentication.ResourceManager.IProfileOperations
[<System.Serializable>]
type AzureRmProfile = class
    interface IAzureContextContainer
    interface IExtensibleModel
    interface IProfileOperations
    interface IDisposable
Public Class AzureRmProfile
Implements IAzureContextContainer, IDisposable, IProfileOperations
Inheritance
AzureRmProfile
Attributes
Implements

Constructors

AzureRmProfile()

Creates new instance of AzureRMProfile.

AzureRmProfile(IDictionary<String,IAzureEnvironment>)

Creates new instance of AzureRMProfile with other EnvironmentTable..

AzureRmProfile(IFileProvider)

Initializes a new instance of AzureRmProfile using a specialized file provider

AzureRmProfile(String, Boolean)

Initializes a new instance of AzureRMProfile and loads its content from specified path.

AzureRmProfile(String)

Properties

Accounts
Contexts
DefaultContext

Gets the default context

DefaultContextKey
Environments
EnvironmentTable

Gets or sets Azure environments.

ExtendedProperties
ProfilePath

Gets the path of the profile file.

ShouldRefreshContextsFromCache
Subscriptions

Methods

Clear()

Set the contaienr to its default state

DeepCopy()

Deep clone the instance of AzureRMProfile.

Dispose()
Dispose(Boolean)
HasEnvironment(String)
RefillCredentialsFromKeyStore()

Refill the credentials from AzKeyStore to profile. Used for profile export.

RefreshContextsFromCache()
Save()

Writes profile to the disk it was opened from disk.

Save(IFileProvider, Boolean)

Writes the profile using the specified file provider

Save(String, Boolean)

Writes profile to a specified path.

Save(String)
ToProfile()
ToString()

Serializes the current profile and return its contents.

ToString(Boolean)

Serializes the current profile, including or not including the token cache

TryAddContext(IAzureContext, String)
TryAddContext(String, IAzureContext)
TryCopyProfile(AzureRmProfile)
TryFindContext(IAzureContext, String)
TryGetContextName(IAzureContext, String)
TryGetEnvironment(String, IAzureEnvironment)
TryRemoveContext(String)
TryRemoveEnvironment(String, IAzureEnvironment)
TryRenameContext(String, String)
TrySetContext(IAzureContext, String)
TrySetContext(String, IAzureContext)

Add the input context with the specified name. If the context with the same tenant, subscription, accountId does not exist, add the input into context list. If the context with the same tenant, subscription, accountId already exist, merge 2 contexes and add the merged context to the context list.

TrySetDefaultContext(IAzureContext)

Set the default context with the input context. If the context with the same name does not exist, add the input into context list and set as default. If the context with the same name already exist, update the attributes with the same names and add the missing attributes.

TrySetDefaultContext(String, IAzureContext)
TrySetDefaultContext(String)
TrySetEnvironment(IAzureEnvironment, IAzureEnvironment)

Extension Methods

GetAccount(IAzureContextContainer, String)
GetAccount(IAzureContextContainer, String)
GetEnvironment(IAzureContextContainer, String)
GetEnvironment(IAzureContextContainer, String)
GetSubscriptionById(IAzureContextContainer, Guid)
GetSubscriptionById(IAzureContextContainer, String)
GetSubscriptionById(IAzureContextContainer, Guid)
GetSubscriptionById(IAzureContextContainer, String)
GetSubscriptionByName(IAzureContextContainer, String)
GetSubscriptionByName(IAzureContextContainer, String)
HasAccount(IAzureContextContainer, String)
HasAccount(IAzureContextContainer, String)
HasEnvironment(IAzureContextContainer, String)
HasEnvironment(IAzureContextContainer, String)
HasSubscriptionId(IAzureContextContainer, Guid)
HasSubscriptionId(IAzureContextContainer, String)
HasSubscriptionId(IAzureContextContainer, Guid)
HasSubscriptionId(IAzureContextContainer, String)
HasSubscriptionName(IAzureContextContainer, String)
HasSubscriptionName(IAzureContextContainer, String)
CopyPropertiesFrom(IExtensibleModel, IExtensibleModel)
GetProperty(IExtensibleModel, String)
GetPropertyAsArray(IExtensibleModel, String)
IsPropertySet(IExtensibleModel, String)
SetOrAppendProperty(IExtensibleModel, String, String[])
SetProperty(IExtensibleModel, String, String[])
UpdateProperties(IExtensibleModel, IExtensibleModel)
GetTokenCache(IAzureContextContainer)
GetTokenCache(IAzureContextContainer)
HasTokenCache(IAzureContextContainer)
HasTokenCache(IAzureContextContainer)
SetTokenCache(IAzureContextContainer, IAzureTokenCache)
SetTokenCache(IAzureContextContainer, IAzureTokenCache)
PopulateExtensions(IExtensibleModel, PSObject)

Populate the model extensions from a PSObject

SetContextWithCache(IAzureContextContainer, IAzureContext, String)

Set the context for the current profile, preserving token cache information. After MSAL, token cache is no longer stored in contexts. So this method roughly equals to TrySetDefaultContext().

SetContextWithCache(IAzureContextContainer, IAzureContext, String)

Applies to