Sdílet prostřednictvím


AzureRMProfileExtensions.SetContextWithCache Method

Definition

Overloads

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)

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().

public static void SetContextWithCache (this Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer profile, Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContext newContext, string name = default);
static member SetContextWithCache : Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer * Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContext * string -> unit
<Extension()>
Public Sub SetContextWithCache (profile As IAzureContextContainer, newContext As IAzureContext, Optional name As String = Nothing)

Parameters

profile
IAzureContextContainer

The profile to change the context for

newContext
IAzureContext

The new context, with no token cache information.

name
String

Applies to

SetContextWithCache(IAzureContextContainer, IAzureContext, String)

public static void SetContextWithCache (this Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer profile, Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContext newContext, string name = default);
static member SetContextWithCache : Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer * Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContext * string -> unit
<Extension()>
Public Sub SetContextWithCache (profile As IAzureContextContainer, newContext As IAzureContext, Optional name As String = Nothing)

Parameters

newContext
IAzureContext
name
String

Applies to