add_activity_to_pipeline
Add custom activities to Microsoft Fabric pipelines using JSON templates for Notebook, Script, Web, or other activity types.
Instructions
Add a generic activity to an existing Fabric pipeline from a JSON template.
Retrieves an existing pipeline, adds an activity from the provided JSON template, and updates the pipeline definition. This is a more general-purpose tool compared to add_copy_activity_to_pipeline, allowing you to add any type of Fabric pipeline activity by providing its complete JSON definition.
Use this tool when:
You have a custom activity JSON template to add
You want to add activity types beyond Copy (e.g., Notebook, Script, Web, etc.)
You need full control over the activity definition
You're working with complex activity configurations
Activity JSON Requirements:
Must be a valid dictionary/object
Must include a "name" field (string)
Must include a "type" field (e.g., "Copy", "Notebook", "Script", "Web", etc.)
Should include all required properties for the specific activity type
Common fields: "dependsOn", "policy", "typeProperties"
Parameters: workspace_name: The display name of the workspace containing the pipeline. pipeline_name: Name of the existing pipeline to update. activity_json: Complete JSON dictionary representing the activity definition. Must include "name", "type", and all required properties.
Returns: Dictionary with status, pipeline_id, pipeline_name, activity_name, activity_type, workspace_name, and message.
Example: ```python # Example 1: Add a Copy Activity from JSON template copy_activity = { "name": "CopyCustomData", "type": "Copy", "dependsOn": [], "policy": { "timeout": "0.12:00:00", "retry": 0, "retryIntervalInSeconds": 30, "secureOutput": False, "secureInput": False }, "typeProperties": { "source": { "type": "AzurePostgreSqlSource", "partitionOption": "None", "queryTimeout": "02:00:00", "datasetSettings": { "type": "AzurePostgreSqlTable", "schema": [], "typeProperties": { "schema": "public", "table": "products" }, "externalReferences": { "connection": "12345678-1234-1234-1234-123456789abc" } } }, "sink": { "type": "LakehouseTableSink", "tableActionOption": "Overwrite", "applyVOrder": True, "datasetSettings": { "type": "LakehouseTable", "typeProperties": { "table": "products" } } } } }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace_name | Yes | ||
| pipeline_name | Yes | ||
| activity_json | Yes |