你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
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>]
说明
重新生成 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
要构造的标识参数,请参阅 INPUTOBJECT 属性的 NOTES 部分并创建哈希表。
类型: | 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
目标订阅的 ID。 该值必须是 UUID。
类型: | String |
Position: | Named |
默认值: | (Get-AzContext).Subscription.Id |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |