'How to store Dynamics CRM solution in DevOps Repo

I am using Wael Hamze's great library to export CRM solutions. I would like to archive the zip files, preferably in a Repository folder. I have selected the Repos folder as the output path. While the export was successful there are no ZIP files added. What do I need to do to make this happen?



Solution 1:[1]

I highly recommend that you look at PowerPlatform Build Tools (https://docs.microsoft.com/en-us/power-platform/alm/devops-build-tools) and PowerApps CLI (PAC) https://docs.microsoft.com/en-us/power-apps/developer/data-platform/powerapps-cli

Build tools integrates directly into DevOps pipelines and will Unzip and Zip solutions for you natively.

You can run PAC commands through powershell and do everything that Build tools won't do.

You can commit from a yml pipeline using a script task similar to the following:

- script: |
    echo commit all changes
    git config user.email "[email protected]"
    git config user.name "Automatic Build"
    git checkout main
    git add --all
    git commit -m "$(pa.environmentPrefrix) portal commit for build $(Build.BuildNumber)"
    
    echo push code to new $(Build.SourceBranch)
    git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" push origin $(Build.SourceBranch)
  displayName: 'Commit $(Build.BuildNumber) changes'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1