-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (75 loc) · 3.43 KB
/
reusable-deploy-bulk.yml
File metadata and controls
82 lines (75 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Reusable workflow: Deploy supported Fabric items via the Bulk Import Item Definitions API (Preview).
#
# Alternative deployment path to reusable-deploy-fabric-cicd.yml. Uses the Fabric
# REST API's bulk import endpoint instead of the fabric-cicd Python library.
# Selected at orchestrator level via the DEPLOY_METHOD repository variable.
#
# Called by: deploy-test-bulk.yml, deploy-prod-bulk.yml
#
# Prerequisites:
# - GitHub Environment secrets: AZURE_TENANT_ID, AZURE_CLIENT_ID,
# AZURE_CLIENT_SECRET, FABRIC_WORKSPACE_ID
# - Service principal must have Contributor (or higher) role on the target workspace
# - Fabric Admin must enable "Service principals can use Fabric APIs"
# - Every item type in the request payload must support service principals
# (the bulk API requires SPN support for ALL items in the request, not just some)
#
# Known gaps vs. reusable-deploy-fabric-cicd.yml (fabric-cicd):
# The Bulk Import API itself has no parameterization, no value-set
# activation, and no delete support. This repo bridges the first two in
# scripts/deploy_bulk.py + data/fabric/bulk-parameter.yml. The remaining
# gaps are intentionally not implemented:
# - No full parameter.yml feature coverage. bulk-parameter.yml supports
# find_replace + $items + $workspace + $environment placeholders only.
# fabric-cicd's key_value_replace, spark_pool, semantic_model_binding
# are not implemented here.
# - No orphan cleanup. The Bulk Import API only supports Create/Update,
# not Delete; deletes would need a separate per-item DELETE call loop.
# - No item_type_in_scope filter. Deploys everything under
# repository_directory.
#
# API references:
# - Bulk import: https://learn.microsoft.com/en-us/rest/api/fabric/core/items/bulk-import-item-definitions(beta)
# - Long running ops: https://learn.microsoft.com/en-us/rest/api/fabric/articles/long-running-operation
#
# TODO: When the Bulk Import API graduates from Preview, drop the ?beta=true
# query parameter and re-verify the endpoint URL.
name: "Reusable: Deploy via Bulk Import API"
on:
workflow_call:
inputs:
environment:
description: "Target environment (Test, Prod)"
required: true
type: string
repository_directory:
description: "Path to the Fabric item definitions"
required: false
type: string
default: "data/fabric"
permissions:
contents: read
jobs:
deploy:
name: Deploy via Bulk Import API (${{ inputs.environment }})
runs-on: ubuntu-latest
timeout-minutes: 30
environment: ${{ inputs.environment }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.12"
- name: Install dependencies
run: pip install requests PyYAML
- name: Bulk import item definitions
env:
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
FABRIC_WORKSPACE_ID: ${{ secrets.FABRIC_WORKSPACE_ID }}
REPOSITORY_DIRECTORY: ${{ inputs.repository_directory }}
ENVIRONMENT: ${{ inputs.environment }}
run: python scripts/deploy_bulk.py