Deploy & ALM
Pipelines
Build and release Logic Fabric projects with Azure DevOps or GitHub Actions using the Logic Fabric CLI.
A pipeline turns a deployment into something you can review, repeat and audit. The examples on this page use only the Logic Fabric CLI, so they work on any build agent with the .NET 10 SDK. Because every command exits with 1 on failure, the pipeline stops at the first problem without extra checks.
The shape of a pipeline
Section titled “The shape of a pipeline”| Stage | Commands | Result |
|---|---|---|
| Build (development environment) | increment-solution-version, publish-api (if the project has APIs), export, docs |
Solution, package, data file and documentation as a build artifact. |
| Deploy to test | import with the test data map files |
Test environment updated. |
| Deploy to production (after approval) | import with the production data map files |
Production updated. |
Keep in the repository:
specs/reference-data.xml data specificationmappings/uat/*.datamap.xml data map files for UATmappings/prod/*.datamap.xml data map files for production (without secrets).config/dotnet-tools.json pins the CLI versionStore connection strings, and any secrets that go into serviceconnection.datamap.xml, in the pipeline’s secret store.
Examples
Section titled “Examples”trigger: branches: include: [ main ]
pool: vmImage: ubuntu-latest
variables: - group: logic-fabric-connections # DevConnection, UatConnection, ProdConnection (secret) - name: ProjectName value: Contoso Service - name: SolutionName value: contososervice
stages: - stage: Build jobs: - job: Export steps: - task: UseDotNet@2 inputs: { version: '10.0.x' } - script: dotnet tool restore displayName: Install Logic Fabric CLI
- script: dotnet tool run flowon-dynamics increment-solution-version -c "$(DevConnection)" -s "$(SolutionName)" -v Build displayName: Increment solution version
- script: dotnet tool run flowon-dynamics publish-api -c "$(DevConnection)" -p "$(ProjectName)" -a "Customer Portal API" -v Minor displayName: Publish API draft
- script: > dotnet tool run flowon-dynamics export -c "$(DevConnection)" -p "$(ProjectName)" -sm -ds specs/reference-data.xml -o "$(Build.ArtifactStagingDirectory)/release" displayName: Export project
- script: > dotnet tool run flowon-dynamics docs -p "$(Build.ArtifactStagingDirectory)/release/Contoso_Service.flop" -o "$(Build.ArtifactStagingDirectory)/docs" displayName: Generate documentation
- publish: $(Build.ArtifactStagingDirectory) artifact: logic-fabric
- stage: DeployUAT dependsOn: Build jobs: - deployment: UAT environment: UAT strategy: runOnce: deploy: steps: - checkout: self - task: UseDotNet@2 inputs: { version: '10.0.x' } - script: dotnet tool restore - script: > dotnet tool run flowon-dynamics import -c "$(UatConnection)" -s "$(Pipeline.Workspace)/logic-fabric/release/$(SolutionName)_managed.zip" -d "$(Pipeline.Workspace)/logic-fabric/release/data.xml" -p "$(Pipeline.Workspace)/logic-fabric/release/Contoso_Service.flop" -m mappings/uat/configuration.datamap.xml mappings/uat/entity.datamap.xml displayName: Import into UAT
- stage: DeployProduction dependsOn: DeployUAT jobs: - deployment: Production environment: Production # add an approval check to this environment strategy: runOnce: deploy: steps: - checkout: self - task: UseDotNet@2 inputs: { version: '10.0.x' } - script: dotnet tool restore - script: > dotnet tool run flowon-dynamics import -c "$(ProdConnection)" -s "$(Pipeline.Workspace)/logic-fabric/release/$(SolutionName)_managed.zip" -d "$(Pipeline.Workspace)/logic-fabric/release/data.xml" -p "$(Pipeline.Workspace)/logic-fabric/release/Contoso_Service.flop" -m mappings/prod/configuration.datamap.xml mappings/prod/entity.datamap.xml displayName: Import into productionAdd an approval check to the Production environment under Pipelines > Environments so a person confirms each production release.
name: Release Contoso Service
on: push: branches: [ main ]
env: PROJECT_NAME: Contoso Service SOLUTION_NAME: contososervice
jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v4 with: { dotnet-version: '10.0.x' } - run: dotnet tool restore
- name: Publish API draft run: dotnet tool run flowon-dynamics publish-api -c "${{ secrets.DEV_CONNECTION }}" -p "$PROJECT_NAME" -a "Customer Portal API" -v Minor
- name: Export project run: > dotnet tool run flowon-dynamics export -c "${{ secrets.DEV_CONNECTION }}" -p "$PROJECT_NAME" -sm -ds specs/reference-data.xml -o release
- uses: actions/upload-artifact@v4 with: { name: release, path: release }
deploy-uat: needs: build runs-on: ubuntu-latest environment: UAT steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 with: { name: release, path: release } - uses: actions/setup-dotnet@v4 with: { dotnet-version: '10.0.x' } - run: dotnet tool restore - name: Import into UAT run: > dotnet tool run flowon-dynamics import -c "${{ secrets.UAT_CONNECTION }}" -s "release/${SOLUTION_NAME}_managed.zip" -d release/data.xml -p release/Contoso_Service.flop -m mappings/uat/configuration.datamap.xml mappings/uat/entity.datamap.xml
deploy-production: needs: deploy-uat runs-on: ubuntu-latest environment: Production # add required reviewers to this environment steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 with: { name: release, path: release } - uses: actions/setup-dotnet@v4 with: { dotnet-version: '10.0.x' } - run: dotnet tool restore - name: Import into production run: > dotnet tool run flowon-dynamics import -c "${{ secrets.PROD_CONNECTION }}" -s "release/${SOLUTION_NAME}_managed.zip" -d release/data.xml -p release/Contoso_Service.flop -m mappings/prod/configuration.datamap.xml mappings/prod/entity.datamap.xmlAdd required reviewers to the Production environment under Settings > Environments.
- Pin the CLI version with a tool manifest (
dotnet new tool-manifest, thendotnet tool install Flowon.Xrm.Tools.CommandLine) and rundotnet tool restorein every job. See Installation. - Use
--log-level infoin pipelines to see progress, andverbosewhen you investigate a failure. - Deploy what you built. Import the artifact from the build stage instead of exporting again for each environment.
- Publish API drafts before exporting.
publish-apirefuses a draft with issues, which stops the build before a broken API reaches test. - Keep data map files per environment in the repository and inject secrets at run time.