Deployment options
In Azure DevOps on the Pipelines page, there is a pipelineAn automated "conveyor belt" that moves data from one place to another or performs a task automatically. to deploy an environment to Microsoft FabricAn all-in-one data and analytics platform from Microsoft. Think of it as a "digital warehouse" for all your company's information.. When 'Run Pipeline' is chosen, the following parameters can be set:
| Name | Description |
|---|---|
| Branch/tag | The branch to be deployed (default=main) |
| environments | Add one or more environments. For example -tst or multiple environments at once |
| Bronze / Silver / Gold | Three separate booleans selecting which layers to deploy (at least one must be selected) |
| Deploy Notebooks | Deploy the notebooks to Fabric (Changed/All/No) |
| Deploy SQL Objects | Deploy objects to the lakehouseA place where you store both "raw" data (like files) and "organized" data (like tables). It combines the best of a File Cabinet and a Database. (Changed/All/No) |
| Deploy Tabular Models | Deploy tabular models to PowerBI.com (Changed/All/No) |
| Deploy Reports | Deploy Power BI reports to PowerBI.com (Changed/All/No) |
| Cleanup obsolete notebooks and tables | Report or delete notebooks and lakehouse tables that no longer exist in the repository (No/Report/Delete, default No). See Cleanup of obsolete objects |
Deploy options (Changed/All/No)
The four deploy parameters share the same values:
- Changed: Only artifacts touched since the last successful deploy to that environment are deployed (a git diff against that run's commit; on a feature branch against the merge-base with
main). If no earlier successful deploy can be found, as on a brand-new platform, nothing is deployed and the run fails with the advice to rerun withAll. When a shared file changes (a notebook template,reports.yaml, ormodel.yamlfor the Gold objects), the pipeline widens the selection automatically. - All: Everything in the category is deployed, regardless of changes.
- No: This step is skipped completely.
The metadata files (YAMLA simple way to write configurations. It's basically a list that computers can read easily.) are uploaded to the Meta lakehouse unconditionally on every deploymentThe process of "pushing a button" to make your configuration actual, working software in the cloud. — there is no separate parameter for them.
Report deployment
The Deploy Reports step deploys the reports listed in the reports.yaml of the report group (reports in dp.<env>.yaml). A report can be a .pbix file or a Power BI project report folder (.Report, saved from Power BI Desktop as PBIP). The step is skipped when no report changed. Give a report a folder (for example folder: "Reports") to place it in that workspace folder; the folder is created when it does not exist.
A report on a shared semantic modelThe "brain" of your data that tells Power BI how different pieces of information relate to each other. names that model per environment. Name it with model; the pipeline looks up its id in the target workspace, so the binding stays correct when the model is redeployed:
connections:
- reference: DM
datasourcetype: "pbiServiceLive"
environments:
- environment: "acc"
model: "DM"
When the model is not found in the workspace, the deployment fails instead of publishing an unbound report. A fixed id in dataset still works when model is left out, but it goes stale whenever the model is recreated.
Cleanup of obsolete objects
By default the pipeline never deletes anything in Fabric. Notebooks and tables you remove from the repository stay in the workspace until you delete them by hand. The Cleanup obsolete notebooks and tables parameter changes that:
- No: nothing is deleted or reported (default).
- Report: every notebook and table that would be deleted is listed as a pipeline warning, nothing is deleted.
- Delete: the obsolete objects are deleted, and every deletion is listed as a pipeline warning.
Deleting is only carried out when the environment allows it. Each dp.<env>.yaml carries a cleanup block that acts as the second lock, so an acceptance environment can allow deletion while production stays on report-only:
cleanup:
notebooks:
enabled: true
exceptfolders: [Users, Development]
tables:
enabled: false
exceptschemas: [his]
excepttables: []
When the pipeline runs with Delete and enabled is false, that category is reported instead of deleted.
Notebooks. The cleanup compares the workspace with the complete set of generated notebooks (all layers, regardless of the layer and Changed/All selections). Only notebooks inside managed folders are candidates: the folders named in the notebook.folder setting of the generated notebooks (for example Bronze, Silver, Gold, DAG, Loaders and Users) and their subfolders. Notebooks in the workspace root or in any other folder are never touched. exceptfolders removes a managed folder, or a subfolder of it, from the cleanup; the template excludes Users (personal USR_ notebooks) and Development. When the generated set is empty the step stops without deleting anything.
Tables. The lakehouse deployment already compares the generated table scripts with the tables present in each schema it deploys. With cleanup enabled the tables that exist in Fabric but no longer in the generated scripts are dropped, per selected layer. Schemas that do not occur in the generated scripts are never scanned. exceptschemas keeps whole schemas, excepttables keeps tables matching a schema.table wildcard pattern such as dbo.manual_*.
How the table cleanup combines with Deploy SQL Objects:
| Deploy SQL Objects | With cleanup on Report or Delete |
|---|---|
No | Cleanup only. No table is created or altered; the obsolete tables are listed, or dropped with Delete. Use No with Report for a true dry run. |
Changed or All | A full SQL deploy of the selected layers, also with Changed: finding obsolete tables needs every table in the scripts. The obsolete tables are listed, or dropped with Delete, after the deploy. |
Dropping a table deletes its data. Fabric has no recycle bin for lakehouse tables. Run with Report first and keep tables.enabled on false in environments where a mistake would be costly.
History tables
A deploy never drops a history table in the Bronze lakehouse. Bronze history is the only data the platform cannot rebuild: the landing table is overwritten on every run, and Silver and Gold are derived from Bronze. Once the source no longer knows an old value, the history table is the only place it still exists.
| Table that is no longer in the model | With cleanup on Delete and tables.enabled: true |
|---|---|
| History table in the Bronze lakehouse | Kept. No setting changes this, including exceptschemas and excepttables. |
| History table in another lakehouse, such as Silver | Dropped, like any other obsolete table. Add the schema to exceptschemas to keep it. |
| Any other table | Dropped, unless exceptschemas or excepttables keeps it. |
The history schema is the schemahistory value of the platform configuration (his by default). When the deploy cannot tell which lakehouse is Bronze, it keeps every history table and the pipeline says so in a warning.
Every deploy lists each Bronze history table that is no longer in the model as a pipeline warning, with its row count, so you can see how much history has fallen outside the model. This happens in all three cleanup modes.
A table that changes shape is recreated: renamed, created again and filled from the renamed copy. The copy is only dropped after the row counts of both tables match. When they do not match, the deploy fails and the renamed table stays, still holding the data. A column that is removed from the model loses its values in this step; the pipeline names those columns in a warning.
To remove a history table, run Yml/scripts/Fabric/cleanup-history-table.py by hand in a Fabric Spark session:
python3 cleanup-history-table.py Bronze.his.adv_products
The script takes one fully qualified table name, shows the row count, and asks you to type that name again as confirmation. Where there is no prompt, such as a Fabric notebook or a Livy session, pass the name a second time with --confirm. It has no wildcard, it only accepts a table in the history schema, and it is not a pipeline step.
The script expects the history schema to be his. A platform that set another schemahistory names it with --history-schema; the pipeline warning for an obsolete history table then shows the option too:
python3 cleanup-history-table.py Bronze.historie.adv_products --history-schema historie
Semantic models and Power BI reports are outside the scope of the cleanup.
The deployment pipeline in Azure DevOps will do the following:
Build
- Check the yaml files for common errors before deploying
- Generate the scripts for the objects to use for deployment
Deployment
- Copy yaml files to the Meta Lakehouse
- Deploy notebooks to the Meta, Bronze, Silver and Gold lakehouse
- Run a notebook that will create* the objects in the different lakehouses