Freigeben über


Add-AzIotHubDeployment

Fügen Sie eine IoT Edge-Bereitstellung in einem IoT-Ziel-IoT-Hub hinzu.

Syntax

Add-AzIotHubDeployment
   [-ResourceGroupName] <String>
   [-IotHubName] <String>
   -Name <String>
   [-ModulesContent <Hashtable>]
   [-Priority <Int32>]
   [-TargetCondition <String>]
   [-Metric <Hashtable>]
   [-Label <Hashtable>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Add-AzIotHubDeployment
   [-InputObject] <PSIotHub>
   -Name <String>
   [-ModulesContent <Hashtable>]
   [-Priority <Int32>]
   [-TargetCondition <String>]
   [-Metric <Hashtable>]
   [-Label <Hashtable>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Add-AzIotHubDeployment
   [-ResourceId] <String>
   -Name <String>
   [-ModulesContent <Hashtable>]
   [-Priority <Int32>]
   [-TargetCondition <String>]
   [-Metric <Hashtable>]
   [-Label <Hashtable>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Beschreibung

Edgebereitstellungen können mit benutzerdefinierten Metriken für die Bedarfsauswertung erstellt werden. Weitere Informationen finden Sie unter https://learn.microsoft.com/azure/iot-edge/module-deployment-monitoring.

Beispiele

Beispiel 1

Add-AzIotHubDeployment -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "deploy1"

Erstellen Sie eine Edgebereitstellung mit Standardmetadaten.

Beispiel 2

Add-AzIotHubDeployment -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "deploy1" -Priority 3 -TargetCondition "tags.building=9 and tags.environment='test'"

Erstellen Sie eine Edgebereitstellung mit einer Priorität von 3, die auf Bedingung angewendet wird, wenn ein Gerät in Gebäude 9 markiert ist und die Umgebung "test" ist.

Beispiel 2

$metrics = @{}
$metrics.add("query1", "select deviceId from devices where tags.location='US'")
Add-AzIotHubDeployment -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "deploy1" -Metric $metrics

Erstellen Sie eine Edgebereitstellung mit Benutzermetriken.

Beispiel 3

$labels = @{}
$labels.add("key0","value0")
$labels.add("key1","value1")
Add-AzIotHubDeployment -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "deploy1" -Label $labels

Erstellen Sie eine Edgebereitstellung mit Bezeichnungen.

Beispiel 4

$content = Get-Content "C:/Edge/modules.json" | ConvertFrom-Json -AsHashtable
Add-AzIotHubDeployment -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "deploy1" -ModulesContent $content -TargetCondition "from devices.modules where tags.environment='test'"

Erstellen Sie eine Edgebereitstellung mit Inhalt.

Parameter

-Confirm

Hiermit werden Sie vor der Ausführung des Cmdlets zur Bestätigung aufgefordert.

Typ:SwitchParameter
Aliases:cf
Position:Named
Standardwert:None
Erforderlich:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

Anmeldeinformationen, Konto, Mandant und Abonnement für die Kommunikation mit Azure

Typ:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Standardwert:None
Erforderlich:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

IotHub-Objekt

Typ:PSIotHub
Position:0
Standardwert:None
Erforderlich:True
Accept pipeline input:True
Accept wildcard characters:False

-IotHubName

Name des Iot Hub

Typ:String
Position:1
Standardwert:None
Erforderlich:True
Accept pipeline input:False
Accept wildcard characters:False

-Label

Zuordnung der Bezeichnungen, die auf die Zielbereitstellung angewendet werden sollen.

Typ:Hashtable
Position:Named
Standardwert:None
Erforderlich:False
Accept pipeline input:False
Accept wildcard characters:False

-Metric

Abfrageauflistung für die Definition von IoT Edge-Bereitstellungsmetriken.

Typ:Hashtable
Position:Named
Standardwert:None
Erforderlich:False
Accept pipeline input:False
Accept wildcard characters:False

-ModulesContent

Bereitstellungsinhalt von Modulen für IoT Edge-Geräte.

Typ:Hashtable
Position:Named
Standardwert:None
Erforderlich:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Bezeichner für die Bereitstellung.

Typ:String
Position:Named
Standardwert:None
Erforderlich:True
Accept pipeline input:False
Accept wildcard characters:False

-Priority

Gewicht der Bereitstellung bei konkurrierenden Regeln (höchste Gewinne).

Typ:Int32
Position:Named
Standardwert:None
Erforderlich:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Name der Ressourcengruppe

Typ:String
Position:0
Standardwert:None
Erforderlich:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

IotHub-Ressourcen-ID

Typ:String
Position:0
Standardwert:None
Erforderlich:True
Accept pipeline input:True
Accept wildcard characters:False

-TargetCondition

Zielbedingung, für die eine Edgebereitstellung gilt.

Typ:String
Position:Named
Standardwert:None
Erforderlich:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Zeigt, was geschieht, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.

Typ:SwitchParameter
Aliases:wi
Position:Named
Standardwert:None
Erforderlich:False
Accept pipeline input:False
Accept wildcard characters:False

Eingaben

PSIotHub

String

Ausgaben

PSDeployment