简体   繁体   English

使用 az cli - bash 脚本获取 ADF 管道状态

[英]Get ADF pipelines status using az cli - bash script

I have been trying to get adf pipelines status using az cli script.我一直在尝试使用 az cli 脚本获取 adf 管道状态。 I am using我在用

az datafactory pipeline-run query-by-factory --factory-name "adfname" --filters operand="Status" operator="Equals" values="Failed" --last-updated-after "2023-01-17T00:00:00.3345758Z" --last-updated-before "2023-01-17T11:59:59.3686473Z" --resource-group "rgname"

command and I am getting full json of pipelines but I only want name and status of these pipelines.命令,我得到了完整的 json 管道,但我只想要这些管道的名称和状态。 I have tried using jQuery like --query "pipelineName", --query "status".我试过使用 jQuery,比如 --query "pipelineName", --query "status"。 Pipeline is succeeding but I am not getting any results.管道正在成功,但我没有得到任何结果。 Please help me for the issue if anyone have knowledge about it.如果有人对此有所了解,请帮助我解决这个问题。

I am expecting result like pipelineName -- status.我期待像 pipelineName -- status 这样的结果。 eg,例如,

pl_databricks -- Failed pl_databricks_mq -- Succeeded. pl_databricks -- 失败 pl_databricks_mq -- 成功。

If possible date and time also如果可能还有日期和时间

pl_databricks -- Failed -- 23/12/22 10:29:27 pl_databricks_mq -- Succeeded -- 23/12/22 08:20:50 pl_databricks -- 失败 -- 23/12/22 10:29:27 pl_databricks_mq -- 成功 -- 23/12/22 08:20:50

  • I have reproduced in my environment and got outputs as below:我已经在我的环境中复制并得到如下输出:
$Target=@()

$x=az datafactory pipeline-run query-by-factory --factory-name "adfname" --filters operand="Status" operator="Equals" values="Succeeded" --last-updated-after "2023-01-15T00:00:00.3345758Z" --last-updated-before "2023-06-16T00:36:44.3345758Z" --resource-group "rgname"

$r=$x | ConvertFrom-Json

$Target= $r.value.pipelinename +" "+ $r.value.status

$Target

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM