AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The activator-cli skill provides a structured interface for interacting with Microsoft Fabric Activator (Reflex) items. It acts as a mode-based dispatcher that separates authoring tasks (creating, updating, or deleting alert rules, sources, and actions) from consumption tasks (listing, inspecting, and decoding existing definitions). The skill enforces strict validation gates for data sources and requires specific handling of JSON payloads to ensure compatibility with Fabric APIs.
What it does
- Creates and configures Activator alert rules and data sources.
- Defines automated actions including Teams notifications, emails, and Fabric item invocations.
- Inspects and decodes existing ReflexEntities definitions.
- Lists and filters workspaces and Activator items for management.
- Validates data sources and signals before rule authoring.
- Manages the lifecycle of Reflex items through REST API operations.
When to use it
- When you need to set up automated alerts based on data thresholds.
- When you need to inspect or audit existing alert rules and their configurations.
- When you need to integrate Fabric Activator with Teams or email for operational notifications.
- When you need to programmatically manage Reflex item definitions.
Advantages
- Provides a clear separation between read-only inspection and state-changing authoring.
- Includes built-in validation gates to prevent invalid rule creation.
- Supports complex alert logic including transition-based detectors.
- Standardizes the handling of Fabric API authentication and telemetry.
Usage examples
- “Create an Activator named sales_alert in my workspace.”
- The agent will switch to authoring mode, read the authoring reference, and execute the POST request to create the Reflex item.
- “Show me all Activators in this workspace.”
- The agent will use consumption mode to list and filter the Reflex items within the specified workspace.
- “Notify me on Teams when the average temperature goes above 30.”
- The agent will validate the temperature source, configure the rule condition, and set up the TeamsMessage action.
- “What rule and action are behind SkillsTestActivator?”
- The agent will use consumption mode to retrieve and decode the ReflexEntities definition for the specified item.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/microsoft/activator-cli/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip activator-cli.zip -d .agents/skills
Documentation by Microsoft
Telemetry — MANDATORY. Every
api.fabric.microsoft.comcall must carryx-ms-fabric-skill: activator-cli(az rest:--headers "x-ms-fabric-skill=activator-cli"), including every LRO poll,fabric_lroand retry. Snippets omit it — add it anyway.
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
Skill disambiguation: use
activator-clifor every Fabric Activator / Reflex item — both authoring alert rules and inspecting existing alerts. The streaming topology that feeds an alert belongs toeventstream-cli, the KQL database behind it toeventhouse-cli, and Power BI report questions tofabriciq.
Fabric Activator (Reflex) — CLI Skill
This one skill owns Fabric Activator / Reflex items: alert rules, their sources, their actions, and the ReflexEntities.json definition that holds them.
It is a mode dispatcher and contains NO procedures. Pick the mode that matches the request from the table below, then read the matching references/<mode>.md file end to end with your file-reading tool BEFORE issuing a single command. That file holds the endpoints, entity schemas, templates and gotchas; acting without it produces invalid ReflexEntities.json payloads and 400s.
The reference is needed to act, not to ask. If the request is under-specified and your next message will be a clarifying question with no Fabric call in it, ask it now and read the reference when you go on to act.
Mode selection
| Mode | Use when the request ... | Example triggers | Read this first |
|---|---|---|---|
authoring | creates, updates, configures or deletes an Activator item, rule, source or action | create an alert, create an activator, create a reflex, 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 | references/authoring.md |
consumption | lists, inspects, decodes or explains existing Activators, rules, sources or actions | show my alerts, what alerts do I have, list activators, inspect this alert, show me the rule, show me the source, get reflex definition, why does this alert fire | references/consumption.md |
Mode boundary rule
consumption is read-only. A request to create, update, configure or delete an Activator item, rule, source or action requires authoring: say so, read references/authoring.md, then proceed.
A pure GET / explain request stays in consumption — do not switch to authoring and do not mutate anything to answer it.
If a request genuinely spans modes, handle them one at a time and read each reference before you start that part. If the mode is ambiguous after reading this table, ask one short clarifying question instead of guessing.
Terminal write — the step you must not skip
Reading the reference, decoding a definition and assembling entities is NOT completing the task. Authoring ends with one state-changing call. If you did not issue it, nothing was persisted — say so explicitly rather than reporting success.
| Mode | Terminal write |
|---|---|
authoring | POST /v1/workspaces/{ws}/reflexes to create the item, POST /v1/workspaces/{ws}/reflexes/{id}/updateDefinition to persist rules, sources and actions, or DELETE /v1/workspaces/{ws}/reflexes/{id} to remove it. Building, stringifying or base64-encoding ReflexEntities.json is not the write. |
consumption | none — this mode is read-only |
Before you report an authoring task done, confirm the terminal call returned an explicit success (HTTP 200/201, or a terminal LRO success for a 202), then read the definition back where the mode reference documents a readback. Power BI sources are the exception: public ALM export can reject an artifact that imported successfully, so an empty or unavailable readback is not proof the write failed — report the updateDefinition result and the readback limitation separately, per references/authoring/powerbi-source.md.
Source validation gate (authoring only)
Before authoring any rule that references a signal, confirm the source is real: resolve it in the requested workspace only, validate that the requested column/field/property exists on it, and observe at least one representative row, event or sample carrying that signal.
Schema-only, zero-row, non-emitting or stale evidence is missing source data. When the source is missing, stop and ask which source and fields provide the signal — do not create a Reflex and do not call updateDefinition on an unrelated existing Activator or Eventstream to force-fit the request, and state plainly that no Activator / Reflex / Eventstream was created or updated. The only exception is an explicit instruction to author against a future / not-yet-emitting source, which you must state as an assumption.
Everything you need to run this gate is on this page. When the request already lacks the source mapping, threshold, recipients or action target, ask for them first — do not read references/authoring.md, and do not call a Fabric API, just to discover that the request is under-specified.
Shared essentials (all modes)
Resolve the workspace and the Activator item first; every mode depends on it — list and filter by display name exactly as CRITICAL NOTES 1 and 2 describe. That recipe is self-contained and is all you need to start.
The table below is optional background living in the shared common/ docs. Open a row only when you actually need that detail. If common/ is not present in your environment, say so in one line and continue with the mode reference — never glob, list or search the filesystem looking for it.
| Task | Reference | Notes |
|---|---|---|
| Finding Workspaces and Items in Fabric | COMMON-CLI.md | Pagination and JMESPath filtering detail |
| Fabric Topology & Key Concepts | COMMON-CORE.md | Item types, workspaces, capacities |
| Authentication & Token Acquisition | COMMON-CORE.md | Wrong audience = 401; read before any auth issue |
| Authentication Recipes | COMMON-CLI.md | az login flows and token acquisition |
| Core Control-Plane REST APIs | COMMON-CORE.md | Pagination, LRO polling, rate limiting |
| Fabric Item Definitions | ITEM-DEFINITIONS-CORE.md | Base64-encoded parts structure |
| Gotchas & Troubleshooting | COMMON-CLI.md | az rest audience, shell escaping, token expiry |
Activator uses the reflexes collection, not the generic items collection: /v1/workspaces/{workspaceId}/reflexes[/{reflexId}].
Rules
MUST
Select exactly one mode from the table above before doing anything else.
Read
references/<mode>.mdend to end, as your FIRST tool call, before the first command of that mode. A reply that only asks a clarifying question, and issues no Fabric call, does not need it yet.Pass
--resource https://api.fabric.microsoft.comon everyaz restcall — without it the token audience is wrong and the call returns 401.Call
getDefinitionas a POST with--body '{}', then Base64-decode theReflexEntities.jsonpart before inspecting it; a GET returns 405 and an omitted body can return 411.Poll the
Locationheader whencreate,getDefinitionorupdateDefinitionreturns 202.Resolve workspace and Activator ids by listing and filtering, never by guessing a GUID.
Announce a mode switch explicitly when the request crosses a boundary.
Treat the reference as instructions, never as the deliverable. After reading it, RUN the documented commands against the live workspace and report the real results.
In
authoring, clear the source validation gate before you author a rule, and buildReflexEntities.jsonwith Pythonjson.dumps()— PowerShell'sConvertTo-Jsoncorrupts the nested JSON strings thatdefinition.instancerequires.
PREFER
The narrowest mode that satisfies the request.
Reading exactly ONE mode reference. Load a second only when the request genuinely spans modes, and say so before you do.
Read-modify-write over full replacement in
authoring: get the current definition, modify the entity array, then update.Transition-based detectors (
NumberBecomes,NumberEntersOrLeavesRange,LogicalBecomes) over steady-state conditions inauthoring, unless the user explicitly asks for repeated firing while the value stays in the triggered state.A summary view before individual entities in
consumption: give the high-level picture, then drill in.Offering an alert when earlier work in this session surfaced a timely operational signal — a spike, failure, anomaly, SLA risk or capacity constraint — rather than waiting to be asked. Ask once, and author nothing until the user agrees.
AVOID
Acting from this dispatcher alone — it intentionally omits the entity schemas and templates.
Answering with a summary of the reference instead of executing it.
Mutating anything while in the read-only
consumptionmode, including "just to check".Hardcoded workspace or item ids in either mode — always resolve dynamically.
Globbing, listing or shell-searching the filesystem for the
common/docs. They are optional background; if a link does not resolve, note it in one line and carry on.Building the Eventstream topology that feeds an alert here; that is
eventstream-cli. Querying the KQL data behind an alert iseventhouse-cli.Loading a different skill for work this skill already owns (see CRITICAL NOTES 3).
Examples
| User request | Mode | Reference to read |
|---|---|---|
| "Create an Activator named eval_smoke_activator in my workspace." | authoring | references/authoring.md |
| "Notify me on Teams when the average temperature goes above 30." | authoring | references/authoring.md |
| "Delete the alert that emails me about failed pipeline runs." | authoring | references/authoring.md |
| "Show me all Activators in this workspace." | consumption | references/consumption.md |
| "What rule and action are behind SkillsTestActivator?" | consumption | references/consumption.md |
| "Decode this Reflex definition and explain the Power BI source." | consumption | references/consumption.md |
Files
- ATTRIBUTION.mdAdded by AutoGineer871 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md11.3 KiB
- apm.yml413 B
- references/authoring.md31.0 KiB
- references/authoring/action-types.md19.9 KiB
- references/authoring/dtb-source.md7.6 KiB
- references/authoring/eventstream-source.md4.9 KiB
- references/authoring/kql-source.md8.8 KiB
- references/authoring/powerbi-source.md16.8 KiB
- references/authoring/real-time-hub-source.md4.0 KiB
- references/authoring/rule-conditions.md23.8 KiB
- references/authoring/source-types.md10.5 KiB
- references/consumption.md17.3 KiB
references/authoring.md
<!-- Mode reference for the `activator-cli` skill. Loaded on demand from `skills/activator-cli/SKILL.md` when the request matches the `authoring` mode. -->
activator-cli authoring mode — Activator Item & Rule Authoring via CLI
Table of Contents
| Task | Reference | Notes |
|---|---|---|
| Finding Workspaces and Items in Fabric | COMMON-CLI.md § Finding Workspaces and Items in Fabric | Optional background — workspace/item ID resolution detail; skip if common/ is unavailable |
| 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 |
| Power BI Source | powerbi-source.md | powerBiSource-v1, stored query payloads, DatasetMetric, filters, persistence, and ALM readback limits |
| 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 Stack
| 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.
Python Patterns
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())Connection
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.
Item CRUD
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 | Body must use displayName (see below). 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 |
Create — Request Body
The item envelope uses displayName, not name. Omitting it fails with HTTP 400 DisplayName field is required.
az rest --method post \
--url "https://api.fabric.microsoft.com/v1/workspaces/${WS_ID}/reflexes" \
--resource "https://api.fabric.microsoft.com" \
--headers "Content-Type=application/json" \
--body '{"displayName":"MyActivator","description":"Alerts on order volume"}'
displayNamevsname— the two are not interchangeable.displayNamebelongs to the item envelope (create and update-metadata bodies).nameappears only insideReflexEntities.jsonentity objects — rules, bindings, data sources, and action arguments — which is why"name"is by far the more common key in the rest of this skill. Do not carry it over to the create body.
In PowerShell, do not inline the JSON: the quoting is mangled before Fabric sees it and the create fails with InvalidInput / Unexpected character encountered while parsing value. Write the body to a file first, and always send Content-Type or the call fails with UnsupportedMediaType.
'{"displayName":"MyActivator","description":"Alerts on order volume"}' |
Set-Content -Path "$env:TEMP\create-reflex-body.json" -Encoding utf8
az rest --method post `
--url "https://api.fabric.microsoft.com/v1/workspaces/$WS_ID/reflexes" `
--resource "https://api.fabric.microsoft.com" `
--headers "Content-Type=application/json" `
--body "@$env:TEMP\create-reflex-body.json"Rule Management via Definitions
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.
Get Definition
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 .Update Definition
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.
ReflexEntities.json — Assembly Procedure
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):
Type:
container-v1. Use the container payload type that matches the source graph:kqlQueriesfor KQL sources,rthSubscriptionsfor Real-Time Hub workspace subscriptions, exact case-sensitivepbiMetricsfor Power BI sources, or the service-created type already present in readback for Eventstream flows.All other entities reference this via
parentContainer.targetUniqueIdentifier
Step 2 — Data Source (exactly 1, pick the right type):
See eventstream-source.md, kql-source.md, dtb-source.md, real-time-hub-source.md, or powerbi-source.md for the supported source workflows
For hand-authored pull sources, set
parentContainer.targetUniqueIdentifier→ Container GUIDFor
eventstreamSource-v1: do not start by hand-authoring the source. Create or update the Eventstream with anActivatordestination first, then read the Activator definition and continue from the auto-createdeventstreamSource-v1+ SourceEvent entities. In public readback, those sink-created entities can appear without explicitparentContainer.For
kqlSource-v1: the KQL query should return ALL data (do NOT pre-filter conditions — let the rule handle that). Must includeeventhouseItem,metadata, andqueryParameters. For Fabric Eventhouse/KQL DB sources, useeventhouseItem: { itemId, workspaceId, itemType: "KustoDatabase" }. For external ADX/Kusto sources, useeventhouseItem: { 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. UseeventTimeSettingsplusDURATION_START/DURATION_ENDqueryParameters whenever the query results have a reasonable timestamp column, and declare those parameters in the KQL withdeclare query_parameters(startTime:datetime, endTime:datetime);. Only use snapshot mode (queryParameters: [], noeventTimeSettings, no time filtering) when the underlying data has no reasonable timestamp column and each row represents current state. See kql-source.md.For
digitalTwinBuilderSource-v1: use a DTB / Ontologyconnectionitem ref{ itemId, workspaceId, itemType }, whereitemTypeis eitherDigitalTwinBuilderorOntology.query.queryStringmust 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. PrefereventTimeSettingsplusDURATION_START/DURATION_ENDquery 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.For
powerBiSource-v1: build the source deterministically from a scoped report/page/visual plus semantic model metadata. Its parent container must use exactpayload.type: "pbiMetrics". Store the source query payload as JSON text inquery.queryStringand a matchingDatasetMetricinmetricDefinition. Persist withupdateDefinition, require explicit HTTP200(or terminal LRO success), and stop on any import error. See powerbi-source.md.
Step 3 — SourceEvent view (exactly 1):
Type:
timeSeriesView-v1, definition.type:"Event", instance:SourceEventtemplate referencing Source byentityIdFor hand-authored pull-source flows, set
parentContainer→ Container GUIDFor Eventstream sink-created flows, reuse the auto-created SourceEvent from readback instead of creating a second one
Step 4 — Choose the entity graph based on trigger type
For
AttributeTriggerrules (thresholds, ranges, text matches, boolean checks, aggregations):Create an Object view
Optionally create SplitEvent if events must be mapped to object instances
Create IdentityPartAttribute and any required BasicEventAttribute entities
One attribute entity per source field, and each entity's name must be unique in the graph.
IdentityPartAttributealready covers the identity field (for exampleDeviceId) — do not add a secondBasicEventAttributewith that same nameWhen you clone an existing attribute entity to add another (the fastest way to reuse a service-accepted envelope), update both the payload
nameand theEventFieldSelectorfieldNameto the new field. CloningTemperatureand renaming only the payload leaves every copy still selectingTemperature, which the service accepts silently and which makes the rule read the wrong columnThe rule then references those value attributes in
ScalarSelectStep
For
EventTriggerrules (fire on every event, heartbeat, event field state/change):Use the minimal graph: Container → Source → SourceEvent → Rule (+ optional
fabricItemAction-v1)Do NOT create Object, SplitEvent, IdentityPartAttribute, or BasicEventAttribute entities unless the scenario truly needs attribute-based modeling
FieldsDefaultsStepmust contain anEventSelectorrow whose nestedEventReference.entityIdpoints to the SourceEvent entity. A top-levelEventReferencerow is invalid.EventTrigger reads raw event fields directly in
FieldsDefaultsStep/EventDetectStep
Step 5 — Rule (1 per alert):
Type:
timeSeriesView-v1, definition.type:"Rule"Always add
"description": "Created by: skills-for-fabric"for user clarityInstance: rule template (see rule-conditions.md)
AttributeTrigger(v1.2.4): ScalarSelectStep → ScalarDetectStep → (DimensionalFilterStep)* → ActStepEventTrigger(v1.2.4): FieldsDefaultsStep → (EventDetectStep)+ → (DimensionalFilterStep)* → ActStep
instanceMUST be a JSON string (usejson.dumps())Every template step inside
instance.steps[]needs anidGUID. Missing step IDs can produce invalid expression graphs because backend translators use the step ID as the output node ID.For
AttributeTrigger, setparentObject→ Object andparentContainer→ ContainerFor
EventTrigger, setparentContainer→ Container and omitparentObjectunless the design explicitly requires itDefault to
settings: { "shouldRun": true, "shouldApplyRuleOnUpdate": false }so newly created rules start in the started / running stateOnly set
shouldRun: falsewhen the user explicitly asks for a stopped rule or when a specific safe verification / eval workflow requires a disabled rule to avoid side effectsFor
TeamsMessageactions with dynamic content, preserve the field-specific reference shapes from working readback: inline mixed-content fragments inheadline/optionalMessageuseAttributeReferencewithtype: "complex", while structuredadditionalInformationentries useNameReferencePair+AttributeReference/EventFieldReferencewithtype: "complexReference"andname: "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):
Type:
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 SetIn the rule's
FabricItemBinding, setfabricJobConnectionDocumentIdto the standalonefabricItemAction-v1.uniqueIdentifierThe target is carried in
payload.fabricItem— nottargetItem, and the ids are not siblings ofjobType:
{
"uniqueIdentifier": "<action-guid>",
"payload": {
"name": "Run alert notebook",
"fabricItem": { "itemId": "<item-guid>", "workspaceId": "<workspace-guid>", "itemType": "SynapseNotebook" },
"jobType": "RunNotebook",
"parentContainer": { "targetUniqueIdentifier": "<container-guid>" }
},
"type": "fabricItemAction-v1"
}itemType/jobTypepairs:SynapseNotebook/RunNotebook,SparkJobDefinition/sparkjob,DataflowFabric/Execute,UserDataFunctions/Execute,Pipeline/PipelineSee action-types.md for per-target schemas and UDF-specific gotchas (
itemTypevs readbackFunctionSet,subitemId, canonicalparameterTypemapping, dynamic parameter shape)
Reference Integrity Preflight
Before every updateDefinition, validate the exact entity array you will send:
Build the set of every top-level
uniqueIdentifierinReflexEntities.json.Confirm every
parentContainer.targetUniqueIdentifier,parentObject.targetUniqueIdentifier,SourceReference.entityId,EventReference.entityId,AttributeReference.entityId, andfabricJobConnectionDocumentIdresolves 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).Confirm each reference points to the expected entity type: containers to
container-v1, source/event/attribute/rule/object references totimeSeriesView-v1when the template expects a view, source references to the source entity, and Fabric item action bindings tofabricItemAction-v1.If any reference is missing, rebuild the graph from the latest
getDefinitionoutput and do not callupdateDefinition.
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.
Entity Wiring Summary
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)Critical: definition.instance is a JSON String
instance 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.
Two Rule Template Types
| 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.
Source Validation Gate
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:
Resolve the source in the requested workspace only -- do not search or substitute another workspace.
Validate that the requested signal column/field exists on that source (KQL table/column, Eventstream field, Real-Time Hub event property, or DTB / Ontology property).
Observe at least one representative row/event/sample carrying that signal -- run the KQL / DTB query or inspect the stream and confirm it actually returns data.
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.
Must / Prefer / Avoid
MUST DO
Confirm a real source before authoring -- follow the Source Validation Gate: resolve the source in the requested workspace, validate the requested signal column/field, and observe at least one representative row/event/sample before authoring. Schema-only, zero-row, non-emitting, or stale evidence is missing source data -- stop and ask which source and fields provide it (plus any missing threshold, recipient, or action details), and state that no Activator/Reflex/Eventstream was created or updated, instead of authoring the rule. If the user explicitly instructs authoring against a future / not-yet-emitting source, state that assumption and continue without claiming the source was observed.
Always use
--resource https://api.fabric.microsoft.comwithaz rest— without it, token audience is wrongAlways send
--body '{}'forgetDefinition— it is a POST and omitting the body can cause 411 errorsAlways Base64-encode
ReflexEntities.jsonpayload when callingupdateDefinitionAlways JSON.stringify the
definition.instancefield intimeSeriesView-v1entities — 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 wrapperAlways use the correct template type —
AttributeTriggerfor value-based conditions (has ScalarSelectStep + ScalarDetectStep),EventTriggerfor event-based firing (has FieldsDefaultsStep + EventDetectStep, no ScalarDetectStep)Always use the canonical EventTrigger selector —
FieldsDefaultsStep.rowscontainsEventSelector(kind: Event) with a nested complexEventReference; never putEventReferencedirectly inrowsAlways use new GUIDs for
uniqueIdentifierwhen adding entities — duplicate GUIDs cause corruptionAlways update all cross-references when changing a
uniqueIdentifier— other entities reference it viatargetUniqueIdentifierAlways run the Reference Integrity Preflight before
updateDefinition-- everytargetUniqueIdentifier,entityId, andfabricJobConnectionDocumentIdin the payload must resolve to an entity included in the submittedReflexEntities.jsonHandle LRO responses —
create,getDefinition, andupdateDefinitionmay return 202; poll theLocationheader
PREFER
Read-modify-write over full replacement — get the current definition, modify the entity array, and update
Soft delete over hard delete unless permanent removal is intended
Discover IDs dynamically via workspace listing + JMESPath rather than hardcoding GUIDs
Transition-based alert conditions over steady-state conditions for most alerts — prefer detectors such as
NumberBecomes,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 trueSteady-state conditions such as
IsGreaterThan,IsLessThan, orIsOutsideRangeonly 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
AVOID
namein the Activator item create body — Fabric item creation requiresdisplayName; sending{"name": ...}fails with HTTP 400DisplayName field is required.nameis valid only insideReflexEntities.jsonentity objects (rules, bindings, action arguments), never on the item envelope. See Create — Request BodytargetItemin afabricItemAction-v1payload — the target object ispayload.fabricItemwithitemId,workspaceIdanditemTypeinside it.targetItemis not part of the schema; a rule built that way is accepted byupdateDefinitionbut never resolves its target.targetUniqueIdentifieris a different thing and belongs toparentContainer. See ReflexEntities.json — Assembly Procedure, Step 6A cloned attribute that still selects the source attribute's field — after copying a
BasicEventAttributeentity, change theEventFieldSelectorfieldNameas well as the payloadname. ABatteryLevelattribute whosefieldNameis stillTemperatureis accepted byupdateDefinitionand silently reads the wrong columnTwo attribute entities with the same name — the identity field already has an
IdentityPartAttribute; adding aBasicEventAttributeof the same name makesScalarSelectStepreferences ambiguousHardcoded workspace or item IDs — always resolve dynamically
Forgetting the
.platformpart — only include it withupdateDefinitionwhen using?updateMetadata=trueSELECT * without filtering on list endpoints — use pagination for large workspaces
Modifying definitions of items with encrypted sensitivity labels —
getDefinitionis blockedPre-filtering conditions in the KQL query — return all data from KQL and let the Activator rule steps handle thresholds, text conditions, and dimensional filters. KQL is the data source, not the rule engine
Inline JSON in PowerShell
az 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 @$pathReusing display names after deletion — soft-deleted items hold their name for several minutes. Use a unique name or hard-delete first
Force-fitting a request onto unrelated existing items -- when no source clears the Source Validation Gate (missing, schema-only, zero-row, non-emitting, or stale), do NOT create a Reflex or call
updateDefinitionon an unrelated existing Activator / Eventstream to satisfy it; ask for the missing source firstRead-only listing or inspection -- use consumption mode for prompts like "show me all Activators", "list Activators", "show the rules", "inspect this alert", or "decode the definition". This authoring skill should only run when the user asks to create, update, delete, configure, or change something.
Examples
Follow the Assembly Procedure to build definitions. See reference docs for complete entity schemas: source-types.md, rule-conditions.md, action-types.md.
Agent Integration Notes
This skill uses the Fabric Items API (
/reflexes) for CRUD and the Definition API for rule managementNo additional data-plane protocols are needed — all operations use
az restwith the Fabric API audienceFor reading Activator items and rules without modifying them, use the consumption mode skill instead
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
What our scanner noticed· Low risk
- Instructions that use the network
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Microsoft
- Publisher
- Microsoft (Official)
- Source
- microsoft/skills-for-fabric · skills/activator-cli · commit f8fac11
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Also distributed in
- microsoft/skills-for-fabric
AutoGineer is not affiliated with or endorsed by Microsoft.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download activator-cli.zip