Set-AzIotHubDeployment
更新IoT Edge部署的可變動欄位。
語法
Set-AzIotHubDeployment
[-ResourceGroupName] <String>
[-IotHubName] <String>
-Name <String>
[-Priority <Int32>]
[-TargetCondition <String>]
[-Metric <Hashtable>]
[-Label <Hashtable>]
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzIotHubDeployment
[-InputObject] <PSIotHub>
-Name <String>
[-Priority <Int32>]
[-TargetCondition <String>]
[-Metric <Hashtable>]
[-Label <Hashtable>]
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzIotHubDeployment
[-ResourceId] <String>
-Name <String>
[-Priority <Int32>]
[-TargetCondition <String>]
[-Metric <Hashtable>]
[-Label <Hashtable>]
[-Force]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
更新IoT Edge部署的指定屬性。 注意:設定內容是不可變的。 可更新的組態屬性為 'labels'、'metrics'、'priority' 和 'targetCondition'。 如需詳細資訊,請參閱 https://learn.microsoft.com/azure/iot-edge/module-deployment-monitoring。
範例
範例 1
Set-AzIotHubDeployment -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "deploy1" -Priority 7 -TargetCondition "tags.building=3 and tags.environment='dev'"
改變IoT Edge部署的優先順序,並更新其目標條件。
範例 2
$labels = @{}
$labels.add("key0","value0")
$metrics = @{}
$metrics.add("query1", "select deviceId from devices where tags.location='US'")
Set-AzIotHubDeployment -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "deploy1" -Label $labels -Metric $metrics
更新 IoT Edge 部署的計量和標籤。
參數
-Confirm
在執行 Cmdlet 之前,提示您進行確認。
類型: | SwitchParameter |
別名: | cf |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Force
允許取代部署物件,即使上次擷取部署物件已更新也一樣。
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-InputObject
IotHub 物件
類型: | PSIotHub |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-IotHubName
IoT 中樞的名稱
類型: | String |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-Label
要套用至目標部署的標籤對應。
類型: | Hashtable |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Metric
查詢 IoT Edge 部署計量定義的集合。
類型: | Hashtable |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Name
部署的標識碼。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-Priority
在競爭規則(最高勝利)的情況下,部署的權數。
類型: | Int32 |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-ResourceGroupName
資源群組的名稱
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ResourceId
IotHub 資源標識碼
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-TargetCondition
套用 Edge 部署的目標條件。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。
類型: | SwitchParameter |
別名: | wi |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |