New-AzCommunicationServiceKey
重新產生 CommunicationService 存取金鑰。 PrimaryKey 和 SecondaryKey 無法同時重新產生。
語法
New-AzCommunicationServiceKey
-CommunicationServiceName <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
[-KeyType <KeyType>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzCommunicationServiceKey
-CommunicationServiceName <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
-Parameter <IRegenerateKeyParameters>
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzCommunicationServiceKey
-InputObject <ICommunicationIdentity>
[-KeyType <KeyType>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzCommunicationServiceKey
-InputObject <ICommunicationIdentity>
-Parameter <IRegenerateKeyParameters>
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
重新產生 CommunicationService 存取金鑰。 PrimaryKey 和 SecondaryKey 無法同時重新產生。
範例
範例 1:使用 IRegenerateKeyParameters 哈希表重新產生主鍵
New-AzCommunicationServiceKey -CommunicationServiceName ContosoAcsResource1 -ResourceGroupName ContosoResourceProvider1 -Parameter @{KeyType="Primary"}
PrimaryConnectionString PrimaryKey
----------------------- ----------
endpoint=<example-primary-endpoint> <example-primarykey>
使先前的主鍵失效,重新產生新的金鑰並傳回它。
範例 2:使用 KeyType 重新產生次要金鑰
New-AzCommunicationServiceKey -CommunicationServiceName ContosoAcsResource1 -ResourceGroupName ContosoResourceProvider1 -KeyType Secondary
SecondaryConnectionString SecondaryKey
----------------------- ----------
endpoint=<example-secondary-endpoint> <example-secondarykey>
使先前的次要金鑰失效,重新產生新的金鑰並傳回它。
參數
-CommunicationServiceName
CommunicationService 資源的名稱。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-Confirm
在執行 Cmdlet 之前,提示您進行確認。
類型: | SwitchParameter |
別名: | cf |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DefaultProfile
DefaultProfile 參數無法運作。 如果針對不同的訂用帳戶執行 Cmdlet,請使用 SubscriptionId 參數。
類型: | PSObject |
別名: | AzureRMContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-InputObject
Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
類型: | ICommunicationIdentity |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-KeyType
要重新產生的keyType。 必須是 'primary' 或 'secondary'(不區分大小寫)。
類型: | KeyType |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Parameter
參數描述重新產生存取密鑰的要求 若要建構,請參閱 PARAMETER 屬性和建立哈希表的 NOTES 一節。
類型: | IRegenerateKeyParameters |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ResourceGroupName
資源群組的名稱。 名稱不區分大小寫。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-SubscriptionId
目標訂用帳戶的標識碼。 此值必須是 UUID。
類型: | String |
Position: | Named |
預設值: | (Get-AzContext).Subscription.Id |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。
類型: | SwitchParameter |
別名: | wi |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |