Files
4c1042343c Closes #845 Add support for PaginatedReport item type (#1037)
## Description

Adds `PaginatedReport` as a supported Fabric item type, enabling CI/CD
deployment of Power BI Paginated Reports.

- **`constants.py`**: Added `PAGINATED_REPORT = "PaginatedReport"` to
`ItemType` enum; inserted at position 13 in `SERIAL_ITEM_PUBLISH_ORDER`
(after `REPORT`); added to `NO_ASSIGNED_CAPACITY_REQUIRED`
- **`_paginatedreport.py`** *(new)*: Simple `PaginatedReportPublisher`
extending `ItemPublisher` — uses default definition deployment, no
custom file processing required
- **`_base_publisher.py`**: Registered `PaginatedReportPublisher` in the
factory method
- **`test_publish.py`**: Added `test_publish_paginated_report_item`
- **`item_types.md`**: Added `## Paginated Report` section

> **Note:** Sample workspace files and HTTP trace regeneration require a
real Fabric workspace export and are left as a follow-up.

## Linked Issue (REQUIRED)

<!-- 
REQUIRED: This PR must be linked to an issue via the PR title format.
PR Title MUST follow this exact format: "Fixes #123 - Short Description"

Use the appropriate action word:
- Fixes #123 (for bug fixes)
- Closes #456 (for features)  
- Resolves #789 (for other changes)

Example: "Fixes #520 - Add Python version requirements to documentation"
-->

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Shira Sassoon <shirasassoon@microsoft.com>
Co-authored-by: shirasassoon <66449905+shirasassoon@users.noreply.github.com>
2026-06-24 17:18:17 +03:00

88 lines
2.6 KiB
Python

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# The following is intended for developers of fabric-cicd to debug locally against the github repo
import sys
from pathlib import Path
from azure.identity import AzureCliCredential, AzurePowerShellCredential, ClientSecretCredential
root_directory = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(root_directory / "src"))
from fabric_cicd import (
FabricWorkspace,
append_feature_flag,
change_log_level,
constants,
publish_all_items,
unpublish_all_orphan_items,
)
# Uncomment to enable debug
# change_log_level()
# Uncomment to add feature flag
append_feature_flag("enable_shortcut_publish")
# The defined environment values should match the names found in the parameter.yml file
workspace_id = "8f5c0cec-a8ea-48cd-9da4-871dc2642f4c"
environment = "PPE"
# In this example, our workspace content sits within the root/sample/workspace directory
repository_directory = str(root_directory / "sample" / "workspace")
# Explicitly define which of the item types we want to deploy
item_type_in_scope = [
"Lakehouse",
"VariableLibrary",
"DataBuildToolJob",
"Dataflow",
"DataPipeline",
"Notebook",
"Environment",
"SemanticModel",
"Report",
"PaginatedReport",
"Eventhouse",
"KQLDatabase",
"KQLQueryset",
"Reflex",
"Eventstream",
"SparkJobDefinition",
"Ontology",
]
# Azure CLI auth - comment out to use a different auth method
token_credential = AzureCliCredential()
# Uncomment to use PowerShell auth
# token_credential = AzurePowerShellCredential()
# Uncomment to use SPN auth
# client_id = "your-client-id"
# client_secret = "your-client-secret"
# tenant_id = "your-tenant-id"
# token_credential = ClientSecretCredential(client_id=client_id, client_secret=client_secret, tenant_id=tenant_id)
constants.DEFAULT_API_ROOT_URL = "https://msitapi.fabric.microsoft.com"
# Initialize the FabricWorkspace object with the required parameters
target_workspace = FabricWorkspace(
workspace_id=workspace_id,
environment=environment,
repository_directory=repository_directory,
item_type_in_scope=item_type_in_scope,
# Explicit token credential required for auth (choose one of the options above)
token_credential=token_credential,
)
# Uncomment to publish
# Publish all items defined in item_type_in_scope
# publish_all_items(target_workspace)
# Uncomment to unpublish
# Unpublish all items defined in scope not found in repository
# unpublish_all_orphan_items(target_workspace, item_name_exclude_regex=r"^DEBUG.*")