共用方式為


New-AzIotHubKey

產生 Azure IoT 中樞 金鑰。

語法

New-AzIotHubKey
   [-ResourceGroupName] <String>
   [-Name] <String>
   [-KeyName] <String>
   [-RenewKey] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzIotHubKey
   [-HubId] <String>
   [-KeyName] <String>
   [-RenewKey] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

產生 Azure IoT 中樞 金鑰。

範例

範例 1 重新產生主鍵

New-AzIotHubKey -ResourceGroupName "myresourcegroup" -Name "myiothub" -KeyName "testKey" -RenewKey "primary"

KeyName		PrimaryKey										SecondaryKey										Rights
-------		----------										------------										------
test		SXSdm31aT+i3939xSnA191f8g3uRhIUCTsO26b9s/nE=	6JqGKGUTL0mhQwvcOeIRT7OnT6noK/tie6jBY77sJTE=		ServiceConnect

Azure iot 中樞授權原則 「testKey」 的重新產生主鍵。

範例 2 交換金鑰

New-AzIotHubKey -ResourceGroupName "myresourcegroup" -Name "myiothub" -KeyName "testKey" -RenewKey "swap"

KeyName		PrimaryKey										SecondaryKey										Rights
-------		----------										------------										------
test		6JqGKGUTL0mhQwvcOeIRT7OnT6noK/tie6jBY77sJTE=	SXSdm31aT+i3939xSnA191f8g3uRhIUCTsO26b9s/nE=		ServiceConnect

交換 azure iot 中樞授權原則 「testKey」 的密鑰。

參數

-Confirm

執行 Cmdlet 之前先提示您確認。

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

-DefaultProfile

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

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

-HubId

IotHub 資源標識碼

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

-KeyName

金鑰的名稱

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

-Name

IotHub 的名稱

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

-RenewKey

重新產生金鑰。

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

-ResourceGroupName

資源群組名稱

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

-WhatIf

顯示執行 Cmdlet 後會發生的情況。 未執行 Cmdlet。

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

輸入

String

輸出

PSSharedAccessSignatureAuthorizationRule