plugins/fabric-authoring/skills/activator-authoring-cli/SKILL.md
Author Fabric Activator rules and Reflex items through Fabric REST API and `az rest`. Invoke for write intents: create or delete items; add or update rule definitions; configure thresholds, filters, Teams/email notifications, Fabric item actions, and Eventhouse/Eventstream/Real-Time Hub/DTB/Ontology sources. Pure GET/explain prompts belong to `activator-consumption-cli`. Clarification for missing sources, thresholds, recipients, and action targets happens inside this skill. Triggers: "create an alert", "create an activator", "create a reflex", "create an activator item", "create an alert item", "notify me when", "let me know when", "take action when", "send me an email when", "send a teams message when", "run a pipeline when", "update an alert", "delete an alert", "activator rule"
npx skillsauth add microsoft/skills-for-fabric activator-authoring-cliInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Update Check — ONCE PER SESSION (mandatory) The first time this skill is used in a session, run the check-updates skill before proceeding.
- GitHub Copilot CLI / VS Code: invoke the
check-updatesskill (e.g.,/fabric-skills:check-updates).- Claude Code / Cowork / Cursor / Windsurf / Codex: read the local
package.jsonversion, then compare it against the remote version viagit fetch origin main --quiet && git show origin/main:package.json(or the GitHub API). If the remote version is newer, show the changelog and update instructions.- Skip if the check was already performed earlier in this session.
CRITICAL NOTES
- To find the workspace details (including its ID) from workspace name: list all workspaces and, then, use JMESPath filtering
- To find the item details (including its ID) from workspace ID, item type, and item name: list all items of that type in that workspace and, then, use JMESPath filtering
| Task | Reference | Notes |
|---|---|---|
| Finding Workspaces and Items in Fabric | COMMON-CLI.md § Finding Workspaces and Items in Fabric | Mandatory — READ link first [needed for workspace/item ID resolution] |
| Authentication & Token Acquisition | COMMON-CORE.md § Authentication & Token Acquisition | Wrong audience = 401 |
| Authentication Recipes | COMMON-CLI.md § Authentication Recipes | Use the shared az login / token guidance from common docs |
| Core Control-Plane REST APIs | COMMON-CORE.md § Core Control-Plane REST APIs | List Workspaces, List Items, Item Creation |
| Long-Running Operations (LRO) | COMMON-CORE.md § Long-Running Operations (LRO) | Create, getDefinition, updateDefinition may return 202 |
| Fabric Item Definitions | ITEM-DEFINITIONS-CORE.md § Definition Envelope | Base64-encoded parts structure |
| Fabric Control-Plane API via az rest | COMMON-CLI.md § Fabric Control-Plane API via az rest | Always pass --resource https://api.fabric.microsoft.com |
| LRO Pattern | COMMON-CLI.md § Long-Running Operations (LRO) Pattern | Poll 202 responses |
| Entity Types, Sources & Views | source-types.md | Entity envelope, source entities, and timeSeriesView-v1 variants |
| Eventstream Source | eventstream-source.md | Push-source workflow: create Eventstream sink first, then extend the discovered Activator entities |
| KQL Source | kql-source.md | KQL source schema, time-axis support, design guidance |
| Digital Twin Builder / Ontology Source | dtb-source.md | DTB / ontology source schema, JSON-string query payloads, snapshot vs time-axis guidance |
| Real-time Hub Source | real-time-hub-source.md | Real-time Hub source schema, workspace event types |
| Rule Conditions | rule-conditions.md | Rule template structure, detection conditions, aggregation, time windows, occurrence options, enrichments |
| Action Types | action-types.md | TeamsMessage, EmailMessage, FabricItemInvocation action schemas |
| Tool | Purpose |
|---|---|
| az CLI | Fabric authentication and REST API token acquisition |
| curl | Header-aware Fabric REST calls through the shared fabric_lro helper |
| jq | JSON filtering and decoded definition inspection |
| python | MUST use for building ReflexEntities.json — json.dumps() handles nested stringification correctly. PowerShell's ConvertTo-Json corrupts nested JSON strings. |
⚠️ CRITICAL: Always use Python (not PowerShell) to build the ReflexEntities.json payload and the API request body.
import json, base64, uuid
# Stringify template → JSON string for definition.instance
instance_string = json.dumps(template_dict, separators=(',', ':'))
# Encode entities and write updateDefinition request body
payload_b64 = base64.b64encode(json.dumps(entities).encode('utf-8')).decode('utf-8')
body = json.dumps({"definition": {"parts": [{"path": "ReflexEntities.json", "payload": payload_b64, "payloadType": "InlineBase64"}]}})
with open('update-body.json', 'w', encoding='utf-8') as f:
f.write(body)
# Then: az rest --method POST --url "...updateDefinition" --resource "https://api.fabric.microsoft.com" --body @update-body.json
# Decode a getDefinition response
response = json.loads(api_output)
for part in response['definition']['parts']:
if part['path'] == 'ReflexEntities.json':
entities = json.loads(base64.b64decode(part['payload']).decode('utf-8'))
# Generate GUIDs for uniqueIdentifier and step id fields
entity_id = str(uuid.uuid4())
Use the shared authentication guidance in COMMON-CLI.md § Authentication Recipes. Resolve workspace and item IDs per COMMON-CLI.md § Finding Workspaces and Items in Fabric. Examples below assume WS_ID and REFLEX_ID are already resolved.
Use the shared mechanics in COMMON-CLI.md § Item CRUD Operations. Activator uses the reflexes endpoint rather than the generic items endpoint:
| Operation | Endpoint | Method | Scopes | Notes |
|---|---|---|---|---|
| Create | /v1/workspaces/{workspaceId}/reflexes | POST | Reflex.ReadWrite.All or Item.ReadWrite.All | May return 202 LRO — use fabric_lro from COMMON-CLI |
| Update metadata | /v1/workspaces/{workspaceId}/reflexes/{reflexId} | PATCH | Reflex.ReadWrite.All or Item.ReadWrite.All | Follow COMMON-CLI metadata update pattern |
| Delete | /v1/workspaces/{workspaceId}/reflexes/{reflexId} | DELETE | Reflex.ReadWrite.All or Item.ReadWrite.All | Add ?hardDelete=true for permanent deletion |
| getDefinition | /v1/workspaces/{workspaceId}/reflexes/{reflexId}/getDefinition | POST | Reflex.ReadWrite.All or Item.ReadWrite.All | Empty body required; may return 202 LRO — use fabric_lro |
| updateDefinition | /v1/workspaces/{workspaceId}/reflexes/{reflexId}/updateDefinition | POST | Reflex.ReadWrite.All or Item.ReadWrite.All | Use Python to build update-body.json, then follow COMMON-CLI updateDefinition pattern |
Rules are managed through getDefinition and updateDefinition. The payload is ReflexEntities.json, a Base64-encoded JSON array of entity objects. Workflow: Get → Decode → Modify → Re-encode → Update.
getDefinitionis a POST (not GET), requires ReadWrite scopes, and may return 202 LRO. Use thefabric_lrohelper from COMMON-CLI.md § Long-Running Operations (LRO) Pattern so 202 responses can be polled via theLocationheader before decoding.
DEFINITION=$(fabric_lro POST \
"https://api.fabric.microsoft.com/v1/workspaces/${WS_ID}/reflexes/${REFLEX_ID}/getDefinition" \
'{}')
echo "$DEFINITION" \
| jq '.definition.parts[] | select(.path=="ReflexEntities.json") | .payload' -r \
| base64 -d | jq .
MUST use Python to build
update-body.json(see Python Patterns), then upload it using the COMMON-CLI updateDefinition pattern against/v1/workspaces/{workspaceId}/reflexes/{reflexId}/updateDefinition.
Build a JSON array of entities in order. Each needs a fresh GUID for uniqueIdentifier. For the hand-authored pull-source flows in this skill, use templateVersion 1.2.4. For Eventstream sink-created flows, preserve the template version already present in the decoded Activator definition; those readbacks can use 1.1.
Step 1 — Container (exactly 1):
container-v1. Use the container payload type that matches the source graph: kqlQueries for KQL sources, rthSubscriptions for Real-Time Hub workspace subscriptions, or the service-created type already present in readback for Eventstream flows.parentContainer.targetUniqueIdentifierStep 2 — Data Source (exactly 1, pick the right type):
parentContainer.targetUniqueIdentifier → Container GUIDeventstreamSource-v1: do not start by hand-authoring the source. Create or update the Eventstream with an Activator destination first, then read the Activator definition and continue from the auto-created eventstreamSource-v1 + SourceEvent entities. In public readback, those sink-created entities can appear without explicit parentContainer.kqlSource-v1: the KQL query should return ALL data (do NOT pre-filter conditions — let the rule handle that). Must include eventhouseItem, metadata, and queryParameters. For Fabric Eventhouse/KQL DB sources, use eventhouseItem: { itemId, workspaceId, itemType: "KustoDatabase" }. For external ADX/Kusto sources, use eventhouseItem: { clusterHostName, databaseName }. Before creating the Activator, run the KQL directly against the target source first and confirm the returned columns, timestamp field, and row shape are correct. Use eventTimeSettings plus DURATION_START/DURATION_END queryParameters whenever the query results have a reasonable timestamp column, and declare those parameters in the KQL with declare query_parameters(startTime:datetime, endTime:datetime);. Only use snapshot mode (queryParameters: [], no eventTimeSettings, no time filtering) when the underlying data has no reasonable timestamp column and each row represents current state. See kql-source.md.digitalTwinBuilderSource-v1: use a DTB / Ontology connection item ref { itemId, workspaceId, itemType }, where itemType is either DigitalTwinBuilder or Ontology. query.queryString must be a JSON-string payload, not KQL. Before creating the Activator, run the DTB / Ontology query directly first and confirm the returned columns, key fields, and timestamp field are correct. Prefer eventTimeSettings plus DURATION_START/DURATION_END query parameters when the returned rows include a reasonable timestamp field; unlike KQL, those duration parameters are applied as DTB endpoint URL query params rather than referenced inside the query body. See dtb-source.md.Step 3 — SourceEvent view (exactly 1):
timeSeriesView-v1, definition.type: "Event", instance: SourceEvent template referencing Source by entityIdparentContainer → Container GUIDStep 4 — Choose the entity graph based on trigger type
For AttributeTrigger rules (thresholds, ranges, text matches, boolean checks, aggregations):
ScalarSelectStepFor EventTrigger rules (fire on every event, heartbeat, event field state/change):
fabricItemAction-v1)FieldsDefaultsStep / EventDetectStepStep 5 — Rule (1 per alert):
timeSeriesView-v1, definition.type: "Rule""description": "Created by: skills-for-fabric" for user clarityAttributeTrigger (v1.2.4): ScalarSelectStep → ScalarDetectStep → (DimensionalFilterStep)* → ActStepEventTrigger (v1.2.4): FieldsDefaultsStep → (EventDetectStep)+ → (DimensionalFilterStep)* → ActStepinstance MUST be a JSON string (use json.dumps())instance.steps[] needs an id GUID. Missing step IDs can produce invalid expression graphs because backend translators use the step ID as the output node ID.AttributeTrigger, set parentObject → Object and parentContainer → ContainerEventTrigger, set parentContainer → Container and omit parentObject unless the design explicitly requires itsettings: { "shouldRun": true, "shouldApplyRuleOnUpdate": false } so newly created rules start in the started / running stateshouldRun: false when the user explicitly asks for a stopped rule or when a specific safe verification / eval workflow requires a disabled rule to avoid side effectsTeamsMessage actions with dynamic content, preserve the field-specific reference shapes from working readback: inline mixed-content fragments in headline / optionalMessage use AttributeReference with type: "complex", while structured additionalInformation entries use NameReferencePair + AttributeReference / EventFieldReference with type: "complexReference" and name: "reference"Example rule entity:
{
"uniqueIdentifier": "<rule-guid>",
"payload": {
"name": "My Rule Name",
"description": "Created by: skills-for-fabric", # Required for user clarity
"parentObject": {"targetUniqueIdentifier": "<object-guid>"},
"parentContainer": {"targetUniqueIdentifier": "<container-guid>"},
"definition": {
"type": "Rule",
"instance": stringify_instance(rule_template),
"settings": {"shouldRun": True, "shouldApplyRuleOnUpdate": False}
}
},
"type": "timeSeriesView-v1"
}
Step 6 — Fabric Item Action (only for FabricItemInvocation):
fabricItemAction-v1 — use this standalone action entity whenever the rule invokes a Fabric item such as a Pipeline, Notebook, Spark job definition, Dataflow, or UDF / Function SetFabricItemBinding, set fabricJobConnectionDocumentId to the standalone fabricItemAction-v1.uniqueIdentifieritemType vs readback FunctionSet, subitemId, canonical parameterType mapping, dynamic parameter shape)Before every updateDefinition, validate the exact entity array you will send:
uniqueIdentifier in ReflexEntities.json.parentContainer.targetUniqueIdentifier, parentObject.targetUniqueIdentifier, SourceReference.entityId, EventReference.entityId, AttributeReference.entityId, and fabricJobConnectionDocumentId resolves to an entity in that same array (or to an unchanged entity from the latest decoded readback that is included in the re-encoded array).container-v1, source/event/attribute/rule/object references to timeSeriesView-v1 when the template expects a view, source references to the source entity, and Fabric item action bindings to fabricItemAction-v1.getDefinition output and do not call updateDefinition.FailedToResolveEntity with DocumentType timeSeriesView not found means a rule, attribute, split event, or event reference points at a timeSeriesView-v1 GUID that is not present in the submitted definition. Treat that as an entity-wiring bug to fix before retrying, not as a transient backend failure.
Container ← everything references this via parentContainer
│
├── Source ← parentContainer → Container
│
├── SourceEvent ← parentContainer → Container
│ │ instance references Source by entityId
│ │
│ ├── EventTrigger Rule ← parentContainer → Container
│ │ minimal event-only path; reads raw event fields directly
│ │
│ └── Object ← parentContainer → Container
│ │
│ ├── (SplitEvent) ← OPTIONAL, parentObject → Object, parentContainer → Container
│ │ instance references SourceEvent by entityId
│ │ maps events to objects via FieldIdMapping
│ │
│ ├── Identity Attr ← parentObject → Object, parentContainer → Container
│ │
│ ├── Value Attr(s) ← parentObject → Object, parentContainer → Container
│ │ instance references SourceEvent (or SplitEvent if used) by entityId
│ │
│ └── AttributeTrigger Rule ← parentObject → Object, parentContainer → Container
│ instance references Value Attr by entityId in ScalarSelectStep
│
└── (FabricItemAction) ← parentContainer → Container (for any FabricItemInvocation action: Pipeline, Notebook, Spark job, Dataflow, or UDF / Function Set)
definition.instance is a JSON Stringinstance inside timeSeriesView-v1 entity's definition is a JSON-encoded string, not a nested object. Always wrap rule templates in the full entity envelope.
❌ WRONG — raw template object (will fail):
{
"templateId": "AttributeTrigger",
"templateVersion": "1.2.4",
"steps": [...]
}
✅ CORRECT — entity envelope with stringified instance:
{
"uniqueIdentifier": "<new-guid>",
"payload": {
"name": "My Rule Name",
"parentObject": { "targetUniqueIdentifier": "<object-guid>" },
"parentContainer": { "targetUniqueIdentifier": "<container-guid>" },
"definition": {
"type": "Rule",
"instance": "{\"templateId\":\"AttributeTrigger\",\"templateVersion\":\"1.2.4\",\"steps\":[...]}",
"settings": { "shouldRun": true, "shouldApplyRuleOnUpdate": false }
}
},
"type": "timeSeriesView-v1"
}
Use json.dumps() to stringify. Do NOT use PowerShell's ConvertTo-Json.
| Template | When to Use | Steps |
|----------|-------------|-------|
| AttributeTrigger | Monitor attribute value (numeric, text, boolean) | ScalarSelectStep → ScalarDetectStep → (DimensionalFilterStep)* → ActStep |
| EventTrigger | Fire on event occurrence (state, change, heartbeat) | FieldsDefaultsStep → (EventDetectStep)+ → (DimensionalFilterStep)* → ActStep |
EventTrigger does NOT have ScalarSelectStep/ScalarDetectStep. Use when acting on events directly. Supports state, change, and heartbeat detection via EventDetectStep.
Before authoring any rule that references a signal (a measurement, field, or event property), confirm the source is real. A requested source only counts as real after all three checks pass:
Treat schema-only, zero-row, non-emitting, or stale evidence as missing source data, not a real source. When the source is missing, stop and ask which source and fields provide the signal (plus any missing threshold, recipient, or action details). Do not create a Reflex or call updateDefinition on any existing Activator / Eventstream to force-fit the request, and state plainly that no Activator / Reflex / Eventstream was created or updated. The only exception is when the user explicitly instructs you to author against a future / not-yet-emitting source.
--resource https://api.fabric.microsoft.com with az rest — without it, token audience is wrong--body '{}' for getDefinition — it is a POST and omitting the body can cause 411 errorsReflexEntities.json payload when calling updateDefinitiondefinition.instance field in timeSeriesView-v1 entities — it must be a string, not a nested object. Always wrap rule templates in the full entity envelope (see the ❌/✅ example above) — never output a raw template object without the entity wrapperAttributeTrigger for value-based conditions (has ScalarSelectStep + ScalarDetectStep), EventTrigger for event-based firing (has FieldsDefaultsStep + EventDetectStep, no ScalarDetectStep)uniqueIdentifier when adding entities — duplicate GUIDs cause corruptionuniqueIdentifier — other entities reference it via targetUniqueIdentifierupdateDefinition -- every targetUniqueIdentifier, entityId, and fabricJobConnectionDocumentId in the payload must resolve to an entity included in the submitted ReflexEntities.jsoncreate, getDefinition, and updateDefinition may return 202; poll the Location headerNumberBecomes, NumberEntersOrLeavesRange, LogicalBecomes, or explicit change conditions even when the user says casual state-like wording such as "is greater than", "is below", or "is outside the range". Treat ordinary alert wording as "notify me when it crosses into that state" to avoid repeated notifications while the condition remains trueIsGreaterThan, IsLessThan, or IsOutsideRange only when the user explicitly asks for repeated firing while the value stays in the triggered state, for example "notify me every time it is greater than 30", "fire on every evaluation while it is above 30", or when a downstream occurrence / windowing pattern truly depends on that semantics.platform part — only include it with updateDefinition when using ?updateMetadata=truegetDefinition is blockedaz rest --body — PowerShell mangles quotes and special characters. Always write JSON to a temp file with [System.IO.File]::WriteAllText($path, $json, [System.Text.UTF8Encoding]::new($false)) and pass --body @$pathupdateDefinition on an unrelated existing Activator / Eventstream to satisfy it; ask for the missing source firstFollow the Assembly Procedure to build definitions. See reference docs for complete entity schemas: source-types.md, rule-conditions.md, action-types.md.
/reflexes) for CRUD and the Definition API for rule managementaz rest with the Fabric API audiencetools
Onboard Log Analytics, Application Insights, and Azure Monitor telemetry into Microsoft Fabric as a Mirrored Catalog, then turn it into business-impact insights by correlating telemetry with business data via Eventhouse shortcuts, verified schemas, and ready-to-use Operations Agent instructions. Triggers: onboard Log Analytics telemetry, connect Application Insights to a Mirrored Catalog, correlate App Insights telemetry with business data, build an Operations Agent for business-impact alerting, determine if availability or latency impacted bookings orders or revenue.
tools
Onboard Log Analytics, Application Insights, and Azure Monitor telemetry into Microsoft Fabric as a Mirrored Catalog, then turn it into business-impact insights by correlating telemetry with business data via Eventhouse shortcuts, verified schemas, and ready-to-use Operations Agent instructions. Triggers: onboard Log Analytics telemetry, connect Application Insights to a Mirrored Catalog, correlate App Insights telemetry with business data, build an Operations Agent for business-impact alerting, determine if availability or latency impacted bookings orders or revenue.
tools
Onboard Log Analytics, Application Insights, and Azure Monitor telemetry into Microsoft Fabric as a Mirrored Catalog, then turn it into business-impact insights by correlating telemetry with business data via Eventhouse shortcuts, verified schemas, and ready-to-use Operations Agent instructions. Triggers: onboard Log Analytics telemetry, connect Application Insights to a Mirrored Catalog, correlate App Insights telemetry with business data, build an Operations Agent for business-impact alerting, determine if availability or latency impacted bookings orders or revenue.
tools
Manage refresh schedules and job execution for an EXISTING Microsoft Fabric Materialized Lake View (MLV) via REST APIs: create, update, and delete refresh schedules (interval-based: hourly, daily, weekly), trigger on-demand refreshes, monitor job status, and cancel running jobs. Uses human-in-the-loop confirmations for safety. This skill does NOT author or create the MLV definition: writing the CREATE MATERIALIZED LAKE VIEW / CREATE OR REPLACE SQL is `spark-authoring-cli`, not this skill. Note: MLV discovery (list MLVs, lineage, data quality) requires UI as REST APIs are not yet available. Triggers: "schedule MLV refresh", "manage MLV refresh", "MLV refresh schedule", "schedule materialized lake view refresh", "automate MLV refresh", "trigger MLV refresh", "monitor MLV refresh", "MLV job status", "cancel MLV refresh", "refresh schedule", "MLV automation", "refresh my materialized views"