Deploy Microsoft Fabric items GitHub Action

I am really excited about introducing the “Deploy Microsoft Fabric workspace items with fabric-cicdGitHub Action in this post. Which appears to be the first Microsoft Fabric related GitHub Action to be made available in the GitHub Marketplace.

Deploy Microsoft Fabric items GitHub Action
Deploy Microsoft Fabric items GitHub Action

This GitHub Action will save a lot of effort when looking to move Microsoft Fabric items from one workspace to another. Because it will allow everybody to operationalize fabric-cicd in GitHub with one GitHub Action.

You can specify this composite GitHub Action in your own GitHub Action workflows within your GitHub repositories. In order to easily deploy the metadata of Microsoft Fabric items stored in your Git repository to another Microsoft Fabric workspace.

Example of Microsoft Fabric items in a Git repository

Typically, this is a GitHub repository that is connected to a Microsoft Fabric workspace by Microsoft Fabric Git integration.

About the Deploy Microsoft Fabric workspace items GitHub Action

Behind the scenes this GitHub Action performs the following steps.

  • Checks out the repository
  • Sets up Python
  • Installs the fabric-cicd Python package
  • Authenticates to Azure using a Service Principal via Az PowerShell
  • Runs a Python deployment script (either auth_spn_deploy_all_workspace.py if items-in-scope input has no value or auth_spn_deploy_fabric_items.py or if items are specified)

This new GitHub Action accepts the below inputs:

  • azure-client-id (required) – Azure Service Principal client id. Ideally stored as an encrypted secret or entered as a parameter.
  • azure-client-secret (required) – Azure Service Principal client secret. Ideally stored as an encrypted secret or entered as a parameter.
  • azure-tenant-id (required) – Azure tenant id. Ideally stored as an encrypted secret or entered as a parameter.
  • workspace-id (required) – Workspace id to pass to the script (can also be provided via repo variables).
  • environment-name (optional) – Environment string (default: Test, can also be provided via repo variables).
  • fabric-cicd-version (optional) – Specific version of fabric-cicd library (default: “,can also be provided via repo variables). Latest version installed when not specified.
  • repository-directory (optional) – Path to repository directory containing workspace items (default: ./workspace, can also be provided via repo variables).
  • items-in-scope (optional) – ItemsInScope argument for the script. Leave blank to deploy all supported items (can also be provided via repo variables).

Below is an example of how you can apply it within your GitHub Actions workflow.

jobs:
  deploy:
    runs-on: windows-latest
    steps:
      - name: Deploy Fabric items
        uses: ChantifiedLens/deploy-microsoft-fabric-items@v1.0.0
        with:
          azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
          azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
          azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
          workspace-id: ${{ vars.TestWorkspace }}
          environment-name: 'Test'
          fabric-cicd-version: '0.1.30'
          repository-directory: './workspace'
          items-in-scope: ${{ vars.ItemsInScope }}

GitHub Action examples

You can find various examples on how to implement this action in the GH-deploy-microsoft-fabric-examples GitHub repository. Another point worth noting that it has been tested with both Windows and Ubuntu GitHub-Hosted Runners.

I hope the “Deploy Microsoft Fabric items” GitHub Action benefits a lot of people out there. Please give it a star in GitHub.

1 thought on “Deploy Microsoft Fabric items GitHub Action”

Leave a Comment