Skip to content

feat: Introduce deploy command#180

Merged
aviatco merged 54 commits intomicrosoft:mainfrom
aviatco:dev/aviatcohen/cli-cicd-intergation-main
Mar 10, 2026
Merged

feat: Introduce deploy command#180
aviatco merged 54 commits intomicrosoft:mainfrom
aviatco:dev/aviatcohen/cli-cicd-intergation-main

Conversation

@aviatco
Copy link
Copy Markdown
Collaborator

@aviatco aviatco commented Mar 5, 2026

📥 Pull Request

✨ Description of new changes

📋 Overview
This PR introduces the new deploy command that integrates with the fabric-cicd library, enabling users to deploy multiple Fabric items in a single operation while addressing authentication challenges through a custom MSAL bridge implementation.

🌟 Key Features

  1. Deploy Command Implementation
    New CLI Command: Added with comprehensive argument parsing
    Configuration File Support: Accepts deployment configuration files via --deploy_config_file parameter
    Target Environment: Supports environment-specific deployments with --target_env
    Parameter Override: JSON parameter support via -P flag for runtime configuration override
    Force Mode: --force flag to bypass confirmation prompts
  2. CICD Library Integration
    Seamless Integration: Direct integration with fabric_cicd.deploy_with_config
    Logging Coordination: Synchronized debug logging between CLI and CICD library
    Feature Flag Management: Automatic feature flag configuration for optimal deployment behavior
    Error Handling: Comprehensive error handling with FabricCLIError wrapping
  3. MSAL Bridge Authentication Solution
    Core Implementation
    MsalTokenCredential: Custom TokenCredential implementation wrapping CLI's MSAL authentication
    Scope Validation: Strict validation ensuring only SCOPE_FABRIC_DEFAULT scopes are accepted
    Multi-Auth Support: Compatible with user login, service principal, managed identity, and environment tokens
    Headless Mode: Always operates in non-interactive mode for CI/CD compatibility
    Security Features
    Scope Restriction: Security validation prevents unauthorized scope requests
    Token Reuse: Leverages existing CLI authentication without requiring re-authentication
    Automatic Refresh: MSAL silent acquisition handles token refresh automatically

Deployment Workflow & Integration:

  • Introduce a deploy command delegate directly to the fabric-cicd library via the updated deploy_with_config_file function in fab_fs_deploy_config_file.py, including feature flag setup, debug logging, and improved error handling with custom exceptions.

Dependency Updates:

  • Added azure-core and fabric-cicd as dependencies in pyproject.toml and requirements-dev.txt to support new deployment features and Azure authentication integration.

Authentication & Token Handling:

  • Introducing MSAL token bridge to handle the authenticating in fabric-cicd

Testing Improvements:

  • Updated test configuration to enable live recording mode for pytest, and improved test request patching to support JSON string parameters for compatibility with fabric_cicd. [1] [2]

Error Handling:

  • Added a new error constant ERROR_IN_DEPLOYMENT to fab_constant.py for clearer error reporting during deployment failures.

Aviat Cohen and others added 30 commits February 19, 2026 12:17
feat: [CLI-CI/CD Integration] Deploy command interface
Co-authored-by: Alon Yeshurun <98805507+ayeshurun@users.noreply.github.com>
[CLI-CI/CD Integration] Create MSAL bridge
Co-authored-by: Alon Yeshurun <98805507+ayeshurun@users.noreply.github.com>
ayeshurun
ayeshurun previously approved these changes Mar 5, 2026
…it add .github/workflows/fab-build.ymlgit add .github/workflows/fab-build.yml
Copy link
Copy Markdown
Contributor

@shirasassoon shirasassoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add a link to reference fabric-cicd's docs on config deployment - https://microsoft.github.io/fabric-cicd/latest/how_to/config_deployment/

ayeshurun
ayeshurun previously approved these changes Mar 9, 2026
@aviatco aviatco force-pushed the dev/aviatcohen/cli-cicd-intergation-main branch from 0a8def4 to 7fb1e55 Compare March 10, 2026 09:06
@aviatco aviatco merged commit c9f2e73 into microsoft:main Mar 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants