Skip to content

Commit ccd7fc8

Browse files
Update how-to-send-notifications-to-teams.md
1 parent 1ba4bd0 commit ccd7fc8

File tree

1 file changed

+30
-14
lines changed

1 file changed

+30
-14
lines changed

articles/data-factory/how-to-send-notifications-to-teams.md

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ Before you can send notifications to Teams from your pipelines you must create a
240240
> [!NOTE]
241241
> These parameters are used to construct the monitoring URL. Suppose you do not provide a valid subscription and resource group (of the same data factory where the pipelines belong). In that case, the notification will not contain a valid pipeline monitoring URL, but the messages will still work. Additionally, adding these parameters helps prevent the need to always pass those values from another pipeline. If you intend to control those values through a metadata-driven approach, then you should modify them accordingly.
242242

243+
> [!TIP]
244+
> We recommend adding the current Data Factory **Subscription ID**, **Resource Group**, and the **Teams webhook URL** (refer to [prerequisites](#prerequisites)) for the default value of the relevant parameters.
245+
243246
1. In the "Configurations" pane, select **Variables**, and then select the **+ New** button define following variables for your pipeline.
244247

245248
| Name | Type | Default Value |
@@ -401,26 +404,39 @@ In this sample usage scenario, we will create a master pipeline with three **Exe
401404

402405
:::image type="content" source="media/how-to-send-notifications-to-teams/execute-pipeline-activity-2-settings.png" alt-text="Shows the "Execute pipeline" activity "OnSuccess Notification" setting pane for "NotifiyTeamsChannelPipeline" pipeline.":::
403406

407+
1. Select third **Execute Pipeline** activity on the canvas, and its "General" pane, to edit its details.
408+
- Specify **OnFailure Notification** for **Name** of the **Execute Pipeline** activity.
409+
- In the "Settings" pane, select **NotifiyTeamsChannelPipeline** pipeline for the **Invoked pipeline** property. Customize the parameters as required based on activity type. For example, I customised the parameters this time as follows:
404410

405-
3. **Invoke Teams Webhook Url** for **Name** of the **Web** activity.
406-
4. We recommend adding the current Data Factory **Subscription ID**, **Resource Group**, and the **Teams webhook URL** (refer to
407-
[prerequisites](#prerequisites)) for the default value of the relevant parameters.
408-
409-
:::image type="content" source="media/how-to-send-notifications-to-teams/webhook-recommended-properties.png" alt-text="Shows the recommended properties of the pipeline created by the "Send notification to a channel in Microsoft Teams" template.":::
411+
| Name | Value |
412+
| :---------------- | :---------------------------------------------------------------------------------------------------------------- |
413+
| subscription | ``11111111-0000-aaaa-bbbb-0000000000`` |
414+
| resourceGroup | ``contosorg`` |
415+
| runId | ``@activity('LoadDataPipeline').output['pipelineRunId']`` |
416+
| name | ``@activity('LoadDataPipeline').output['pipelineName']`` |
417+
| triggerTime | ``@activity('LoadDataPipeline').ExecutionStartTime`` |
418+
| status | ``@activity('LoadDataPipeline').Status`` |
419+
| message | ``@activity('LoadDataPipeline').Error['message']`` |
420+
| executionEndTime | ``@activity('LoadDataPipeline').ExecutionEndTime`` |
421+
| runDuration | ``@activity('LoadDataPipeline').Duration`` |
422+
| teamWebhookUrl | ``https://microsoft.webhook.office.com/webhookb2/1234abcd-1x11-2ff1-ab2c-1234d0699a9e@72f988bf-32b1-41af-91ab-2d7cd011db47/IncomingWebhook/8212f66ad80040ab83cf68b554d9232a/17d524d0-ed5c-44ed-98a0-35c12dd89a6d`` |
410423

411-
These parameters are used to construct the monitoring URL. Suppose you do not provide a valid subscription and resource group (of the same data factory where the pipelines belong). In that case, the notification will not contain a valid pipeline monitoring URL, but the messages will still work. Additionally, adding these parameters helps prevent the need to always pass those values from another pipeline. If you intend to control those values through a metadata-driven approach, then you should modify them accordingly.
412-
413-
1. Add an **Execute Pipeline** activity into the pipeline from which you would like to send notifications on the Teams channel. Select the pipeline generated from the **Send notification to a channel in Microsoft Teams** template as the **Invoked pipeline** in the **Execute Pipeline** activity.
424+
- Create a dependency condition for the third **Execute Pipeline** activity so that it only runs if the first **Execute Pipeline** activity fails. To create this dependency, click the red handle on the right side of the first **Execute Pipeline** activity, drag it, and connect it to the third **Execute Pipeline** activity.
425+
426+
- Validate, debug, and then publish your **MasterPipeline** pipeline.
427+
428+
:::image type="content" source="media/how-to-send-notifications-to-teams/execute-pipeline-activity-3-general.png" alt-text="Shows the "Execute pipeline" activity "OnSuccess Notification" general pane for "NotifiyTeamsChannelPipeline" pipeline.":::
429+
430+
:::image type="content" source="media/how-to-send-notifications-to-teams/execute-pipeline-activity-3-settings.png" alt-text="Shows the "Execute pipeline" activity "OnSuccess Notification" setting pane for "NotifiyTeamsChannelPipeline" pipeline.":::
431+
432+
1. Run pipeline to receive notifications in Teams. For example, below are sample notifications, when my pipeline ran successfully and when it failed.
414433

415-
:::image type="content" source="media/how-to-send-notifications-to-teams/execute-pipeline-activity.png" alt-text="Shows the "Execute pipeline" activity in the pipeline created by the "Send notification to a channel in Microsoft Teams" template.":::
434+
:::image type="content" source="media/how-to-send-notifications-to-teams/teams-notifications-view-pipeline-run-onsuccess.png" alt-text="Shows on success pipeline notifications in a Teams channel.":::
416435

417-
1. Customize the parameters as required based on activity type.
436+
:::image type="content" source="media/how-to-send-notifications-to-teams/teams-notifications-view-pipeline-run-onfailure.png" alt-text="Shows on failure pipeline notifications in a Teams channel.":::
418437

419-
:::image type="content" source="media/how-to-send-notifications-to-teams/customize-parameters-by-activity-type.png" alt-text="Shows customization of parameters in the pipeline created by the "Send notification to a channel in Microsoft Teams" template.":::
420-
 
421-
1. Receive notifications in Teams.
438+
1. Click the "View pipeline run" button to view pipeline run.
422439

423-
:::image type="content" source="media/how-to-send-notifications-to-teams/teams-notifications-view-pipeline-run.png" alt-text="Shows pipeline notifications in a Teams channel.":::
424440
## Add dynamic messages with system variables and expressions
425441

426442
You can use [system variables](control-flow-system-variables.md) and [expressions](control-flow-expression-language-functions.md) to

0 commit comments

Comments
 (0)