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 ******************************** ******************************** ServiceConnect
Azure iot 中樞授權原則 「testKey」 的重新產生主鍵。
範例 2 交換金鑰
New-AzIotHubKey -ResourceGroupName "myresourcegroup" -Name "myiothub" -KeyName "testKey" -RenewKey "swap"
KeyName PrimaryKey SecondaryKey Rights
------- ---------- ------------ ------
test ******************************** ******************************** 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 |