From 87261b741b1cd9d606e0df95092ef7ab2cbcbacb Mon Sep 17 00:00:00 2001 From: yophilav <54859653+yophilav@users.noreply.github.com> Date: Fri, 25 Jun 2021 12:15:55 -0700 Subject: [PATCH] Update Azure CLI command in Nested pipelines (#5150) (#5162) Update Azure CLI command in Nested pipelines Cherry-picked: https://github.com/Azure/iotedge/commit/9bb6faf4fb600842480f22c548fd454e9897a023 --- builds/e2e/templates/nested-create-identity.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/builds/e2e/templates/nested-create-identity.yaml b/builds/e2e/templates/nested-create-identity.yaml index 401ad6654ec..959ed8b6f82 100644 --- a/builds/e2e/templates/nested-create-identity.yaml +++ b/builds/e2e/templates/nested-create-identity.yaml @@ -25,11 +25,12 @@ steps: echo "Creating ${deviceId} iotedge in iothub: ${iotHubName}, in subscription $(azure.subscription)" if [ "$LEVEL" = "5" ]; then - az iot hub device-identity create -n ${iotHubName} -d ${deviceId} --ee --output none + az iot hub device-identity create -n ${iotHubName} -d ${deviceId} --ee --output none else - echo "Attaching device Id to parent device Id: $(parentDeviceId)" - - az iot hub device-identity create -n ${iotHubName} -d ${deviceId} --ee --pd $(parentDeviceId) --output none + echo "Create device identity and relate it to the parent device Id: $(parentDeviceId)" + + az iot hub device-identity create -n ${iotHubName} -d ${deviceId} --ee --output none && \ + az iot hub device-identity parent set --device-id ${deviceId} --hub-name ${iotHubName} --pd $(parentDeviceId) fi connectionString=$(az iot hub device-identity connection-string show -d ${deviceId} -n ${iotHubName} --query 'connectionString' -o tsv)