共用方式為


Set-AzAksClusterCredential

重設現有 AKS 叢集的 ServicePrincipal。

語法

Set-AzAksClusterCredential
   [-ResourceGroupName] <String>
   [-Name] <String>
   -ServicePrincipalIdAndSecret <PSCredential>
   [-PassThru]
   [-AsJob]
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [-SubscriptionId <String>]
   [<CommonParameters>]
Set-AzAksClusterCredential
   -InputObject <PSKubernetesCluster>
   -ServicePrincipalIdAndSecret <PSCredential>
   [-PassThru]
   [-AsJob]
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [-SubscriptionId <String>]
   [<CommonParameters>]
Set-AzAksClusterCredential
   [-Id] <String>
   -ServicePrincipalIdAndSecret <PSCredential>
   [-PassThru]
   [-AsJob]
   [-Force]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [-SubscriptionId <String>]
   [<CommonParameters>]

Description

重設現有 AKS 叢集的 ServicePrincipal。

範例

範例 1

$SecPasswd = ConvertTo-SecureString -String "****" -AsPlainText -Force
$Credential = $(New-Object System.Management.Automation.PSCredential ('6f277dd3-e481-4518-8aab-35c31662bad9', $SecPasswd))
Set-AzAksClusterCredential -ResourceGroupName $ResourceGroupName -Name $Name -ServicePrincipalIdAndSecret $Credential -force

使用資源組名和叢集名稱設定現有 kubernetes 叢集的服務主體。

參數

-AsJob

在背景執行 Cmdlet

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzContext, AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Force

拿掉受控 Kubernetes 叢集而不提示

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Id

受控 Kubernetes 叢集的標識碼

類型:String
別名:ResourceId
Position:0
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-InputObject

PSKubernetesCluster 物件,通常會通過管線。

類型:PSKubernetesCluster
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-Name

受控 Kubernetes 叢集的名稱

類型:String
Position:1
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-PassThru

如果重設成功,則傳回 true。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ResourceGroupName

資源組名

類型:String
Position:0
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-ServicePrincipalIdAndSecret

與服務主體相關聯的用戶端標識碼和客戶端密碼。

類型:PSCredential
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-SubscriptionId

訂用帳戶的標識碼。 根據預設,Cmdlet 會在目前內容中設定的訂用帳戶中執行。 如果使用者指定另一個訂用帳戶,則會在使用者指定的訂用帳戶中執行目前的 Cmdlet。 覆寫訂閱只會在目前 Cmdlet 的生命週期內生效。 它不會變更內容中的訂用帳戶,而且不會影響後續的 Cmdlet。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。

類型:SwitchParameter
別名:wi
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

輸出