microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.45k stars 2.6k forks source link

[BUG]: AzureIoTEdgeV2 Partial deployment broken #19499

Open eanavalentin opened 6 months ago

eanavalentin commented 6 months ago

New issue checklist

Task name

AzureIoTEdge

Task version

2.*

Issue Description

The Deploy to IoT Edge action does not support partial deployments.

Partial deployments must have content already inside - see this iotedgedev issue

Instead of checking if the deployment file already contains a content section, it tryes to add this to all and any deployment files, which then causes the az iot edge deployment create to fail, as the structure of the deployment file is no longer correct.

Link to relevant portion of the code

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

windows, ubuntu

Relevant log output

2024-02-02T09:50:47.6794225Z [command]/usr/bin/az "iot" "edge" "deployment" "create" "--deployment-id" "REDACTED" "--hub-name" "REDACTED" "--content" "/tmp/deployment_1706867440230.json" "--target-condition" "REDACTED" "--priority" "0" "--output" "none"
2024-02-02T09:50:49.0739850Z ERROR: Edge deployment payloads require property: modulesContent

Full task logs with system.debug enabled

 [2024-02-02T09:50:47.6794225Z [command]/usr/bin/az "iot" "edge" "deployment" "create" "--deployment-id" "REDACTED" "--hub-name" "REDACTED" "--content" "/tmp/deployment_1706867440230.json" "--target-condition" "REDACTED" "--priority" "0" "--output" "none"
2024-02-02T09:50:49.0739850Z ERROR: Edge deployment payloads require property: modulesContent] 

Repro steps

No response

eanavalentin commented 4 months ago

Any update on this?