#5 Microsoft Fabric: Create data Pipeline using Data Factory

The Pipeline in Microsoft Fabric comes from Azure Data Factory which allows us to execute a group of actions and combine them into a single workflow. For example, we may want to create the Pipeline to send out an email, copy data and save it somewhere, run a procedure, etc.

In this article, we will create a Pipeline to send notifications to our email if the Dataflow is not running successfully.

1. Navigate to your workspace named Test_MSFabric

2. Select the Lakehouse item named TestLH within your workspace.

No alt text provided for this image

3. Once you’re in the Lakehouse editor, select New data pipeline.

No alt text provided for this image

4. Set the pipeline name as you want or use default name pipeline1. Then select Create.

No alt text provided for this image

5. Close the Copy data assistant by selecting Cancel. If you’re prompted to confirm exiting the copy data window, select Yes, cancel.

No alt text provided for this image

6. Once you’re in the pipeline editor, select Add pipeline activity, and then select Dataflow.

No alt text provided for this image

7. Select the dataflow activity within the pipeline editor and change its Name value to OnlineSalesActivity within the General section.

No alt text provided for this image

8. With the dataflow activity still selected, select Settings and choose OnlineSalesDataflow from the Dataflow list. If necessary to update the list, select the Refresh icon.

No alt text provided for this image

9. Select the Activities tab and then Set variable activity.

No alt text provided for this image

10. In the Settings of this activity, create a new variable, and name it StartTime with the Data Type of String. In the Value, write @utcnow.

No alt text provided for this image

11. For each Activity, create four next steps after that; On skip, On success, On fail, and On completion. By using each of these four outputs, you can build the full control flow in the Data Pipeline.

No alt text provided for this image

12. Connect the On succeed output of the first activity to DataFlow by dragging and dropping from the on succeed of the “Set variable 1” activity to the “Dataflow” activity.

No alt text provided for this image

13. Add another Set Variable for the third activity, and set it to the same @utcnow value but to a new variable named EndTime.

No alt text provided for this image

14. For the last activity, select the Activities tab and then the Office 365 Outlook activity. If a Grant consent window appears, select Ok, sign in with your organizational account and then select Allow access.

No alt text provided for this image

15. Select the Office 365 Outlook activity within the pipeline editor and change its Name value to “Mail on failure” within the General section.

No alt text provided for this image

16. With the Office 365 Outlook activity still selected, select Settings. Update the To field to your e-mail address and the Subject to Pipeline failure. Select the Add dynamic content [Alt+Shift+D] for the mail Body.

You can configure more e-mail configuration options such as From (Send as), Cc, Bcc, Sensitivity label and more are available from Advanced properties.

17. In the Pipeline expression builder, paste the following expression code block:

 @concat(
	    'Pipeline: '
	    , 
	    , '<br>'
	    , 
	    'Workspace: '
	    , 
	    , '<br>'
	    , 'Time: '
	    , 
	)
No alt text provided for this image

18. Select System variables and insert the following variables by selecting the corresponding name from the following table.

Value name Line System variable

Pipeline: 3 Pipeline name

Workspace: 6 Workspace name

No alt text provided for this image

19. Select Functions and insert the following function by selecting the corresponding name from the following table. Once complete select OK.

Value name Line System variable

Time: 9 utcnow

No alt text provided for this image

20. Select the OnlineSalesActivity and from the available path options, select and hold the “X” (On fail) to create an arrow that will be dropped on the Set variable2 activity.

Similarly, select the Set variable2 activity and from the available path options, select and hold the “v” (On success) to create an arrow that will be dropped on the “Mail on failure” activity. This activity will now be invoked if the OnlineSalesActivity fails.

No alt text provided for this image

21. From the Home tab, select Schedule. Once you have updated the following configurations, select Apply to save your changes.

Name Value

Scheduled run On

Repeat Daily

Time 01:00 AM

No alt text provided for this image

22. From the Home tab, select Run. If a dialog window is displayed select the Save and run option to continue.

No alt text provided for this image

23. To monitor the pipeline’s current status, you can view the Output table, which displays the current activity progress. The table will periodically refresh on its own, or you can manually select the refresh icon to update it.

No alt text provided for this image
Call Now