0

如果直到活动在 5 分钟后跳过。我需要发邮件。

How to send the message from until to email notification pipeline. 

Email notification have message as a parameter. What is the correct Syntax if pipeline skipped 

<p>Hi All,<\/p>\r\n<p>Below pipeline got failed please find the error details.<\/p><br \/>\r\n<p>Pipeline Name : @{pipeline().Pipeline}<\/p>\r\n<p>Error Detail : <br\/>@{activity('LKP_INF_JOB_STATUS').output.error.message}<\/p>\r\n<p>&nbsp;<\/p>\r\n<p>Thanks,<br\/>SPC Support Team<\/p>\r\n<p>&nbsp;<\/p>\r\n<p><br \/>Note:This is an auto-generated email from XYZ, please do not reply directly to this email.<\/p>


[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/yUtUQ.png
4

1 回答 1

0

我为此实现了一个简单的解决方案:

1.给你的直到活动一个特定的超时

直到活动

2. 创建一个 Web Activity,它使用 ADF API 来使用 Completion 依赖(蓝色箭头)查询直到 Activity

有关如何在 ADF 中使用此 API 的详细信息,请参阅此 Stack Overflow: How to get output parameter from Executed Pipeline in ADF?

API Web Activity 获取 Activity 状态

网址: https://management.azure.com/subscriptions/@{pipeline().parameters.SubscriptionId}/resourceGroups/@{pipeline().parameters.ResourceGroupName}/providers/Microsoft.DataFactory/factories/@{pipeline().DataFactory}/pipelineruns/@{pipeline().RunId}/queryActivityruns?api-version=2018-06-01

身体:

{
  "lastUpdatedAfter": "2018-06-16T00:36:44.3345758Z",
  "lastUpdatedBefore": "@{utcnow()}",
  "filters": [
    {
      "operand": "ActivityName",
      "operator": "Equals",
      "values": [
        "Until Timeout after 1 min"
      ]
    }
  ]
}

3. 使用 Switch 中活动的输出来确定要使用的电子邮件活动(失败或超时)

切换活动

表达:

@activity('Check Until Activity Status').output.value[0].status

4. 电子邮件活动

电子邮件活动

{
  "personalizations": [
    {
      "to": [
        {
          "email": "YourEmail@blah.com",
          "name": "blah"
        }
      ],
      "cc": [
        {
          "email": "jane_doe@example.com",
          "name": "Jane Doe"
        }
      ],
      "bcc": [
        {
          "email": "james_doe@example.com",
          "name": "Jim Doe"
        }
      ]
    }
  ],
  "from": {
    "email": "blah@example.com",
    "name": "Blah"
  },

  "subject": "SkipEmail",
  "content": [
    {
      "type": "text/html",
      "value": "This is a Skip Example, put whatever here"
    }
  ]


}
于 2021-07-21T15:30:18.823 回答