- Python 67.1%
- Shell 32.9%
| .ai-chats | ||
| extracted-apps | ||
| msapp-bulk-download | ||
| msapp-library | ||
| msapp-toolkit | ||
| scripts | ||
| upload-ready | ||
| .gitignore | ||
| power-platform.config.yaml | ||
| README.md | ||
| RESUME.md | ||
| WORKFLOW-DIAGRAM.md | ||
pacage-deploy
Self-contained Power Platform deployment and version control toolkit.
This package provides complete workflow automation for downloading, extracting, modifying, and re-uploading Power Platform canvas apps using source control.
Features
- Download all canvas apps from your Power Platform tenant
- Extract .msapp files to human-readable source format
- Version control Power Apps with Git
- Compact modified sources back to .msapp format
- Upload to Power Platform via CLI or portal
- Interactive workflow menu
Quick Start
1. Prerequisites
# Check prerequisites (interactive menu option 7)
./scripts/workflow-menu.sh
Required:
- PAC CLI (Power Platform CLI)
- Python 3.11+
- Git (for version control)
2. Setup Python Environment
# Create virtual environment for msapp-toolkit
cd msapp-toolkit
python3 -m venv venv
# Activate (Linux/macOS)
source venv/bin/activate
# Activate (Windows Git Bash)
source venv/Scripts/activate
# Install msapp-toolkit
pip install -e .
# Verify installation
msapp --version
3. Authenticate to Power Platform
# Create authentication profile
pac auth create
# List authenticated environments
pac auth list
4. Run the Workflow
# Start interactive menu
./scripts/workflow-menu.sh
Directory Structure
pacage-deploy/
scripts/
workflow-menu.sh # Interactive menu
download-and-extract-workflow.sh # Download & extract all apps
compact-and-upload-helper.sh # Compact & upload helper
msapp-bulk-download/
traverse-and-download-all.sh # PAC CLI bulk downloader
msapp-toolkit/ # Python CLI tool
src/msapp_toolkit/ # Source code
pyproject.toml # Package config
venv/ # Virtual environment (created on setup)
msapp-library/ # Downloaded artifacts
downloads/ # Downloaded .msapp files
canvas-apps/ # Organized by app
solutions/ # Solution exports
flows/ # Power Automate flows
connectors/ # Custom connectors
extracted-apps/ # Extracted source code
latest -> YYYYMMDD_HHMMSS/ # Quick access symlink
upload-ready/ # Compacted .msapp files
latest -> YYYYMMDD_HHMMSS/ # Quick access symlink
power-platform.config.yaml # Configuration file
WORKFLOW-DIAGRAM.md # Visual workflow diagram
README.md # This file
Workflows
Download & Extract (Menu Option 1)
Downloads all canvas apps from your Power Platform tenant and extracts them for version control.
./scripts/download-and-extract-workflow.sh
What it does:
- Authenticates to all environments in your tenant
- Downloads all canvas apps (.msapp files)
- Exports all solutions (.zip files)
- Extracts each .msapp to source folders
- Generates summary report
- Creates
latestsymlink for quick access
Output:
extracted-apps/
YYYYMMDD_HHMMSS/
extracted-apps/
Environment-1/
App1/
AppCheckerResult.sarif
Header.json
Properties.json
Src/
Screen1.fx.yaml
Screen2.fx.yaml
...
App2/
Environment-2/
App3/
workflow-report.txt
latest -> YYYYMMDD_HHMMSS/
Compact & Upload (Menu Option 2)
Compacts modified source folders back to .msapp format for upload to Power Platform.
./scripts/compact-and-upload-helper.sh
What it does:
- Discovers all extracted app folders
- Offers interactive selection (all or specific apps)
- Compacts each selected app to .msapp
- Preserves environment structure
- Provides upload instructions
Output:
upload-ready/
YYYYMMDD_HHMMSS/
Environment-1/
App1.msapp
App2.msapp
Environment-2/
App3.msapp
compact-report.txt
latest -> YYYYMMDD_HHMMSS/
Upload to Power Platform
After compacting, upload using either method:
Option 1: Power Apps Studio (GUI)
- Go to https://make.powerapps.com
- Navigate to Apps > Import canvas app
- Upload the .msapp file
- Follow the import wizard
Option 2: PAC CLI (Command Line)
pac canvas create --msapp ./upload-ready/latest/Environment-1/App1.msapp
Version Control with Git
After extracting apps, initialize Git version control:
cd extracted-apps/latest/extracted-apps
git init
git add .
git commit -m "Initial import of Power Apps"
Make changes to the source files, then:
git add .
git commit -m "Updated App1 screen layout"
Configuration
Edit power-platform.config.yaml to customize:
download:
target_dir: "./msapp-library/downloads"
batch_auth: true
export_both_solution_types: true
extract:
output_dir: "./extracted-apps"
create_backups: true
preserve_timestamps: true
compact:
output_dir: "./upload-ready"
validate: true
create_backups: true
toolkit:
python_venv: "./msapp-toolkit/venv"
verbose: false
Menu Options
| Option | Description |
|---|---|
| 1 | Download & Extract All Apps |
| 2 | Compact & Upload Helper |
| 3 | View Latest Extraction |
| 4 | View Latest Compacted Apps |
| 5 | Edit Configuration |
| 6 | View Documentation |
| 7 | Check Prerequisites |
| 8 | Setup Python Environment |
| 0 | Exit |
Troubleshooting
PAC CLI not found
# Install PAC CLI
# See: https://learn.microsoft.com/en-us/power-platform/developer/cli/introduction
PAC CLI not authenticated
# Create authentication profile
pac auth create
# For specific environment
pac auth create --url https://your-org.crm.dynamics.com
msapp-toolkit not installed
cd msapp-toolkit
python3 -m venv venv
source venv/bin/activate # or venv/Scripts/activate on Windows
pip install -e .
No apps found during download
- Verify you have access to the environments
- Check
pac auth listshows your environments - Run
pac canvas listto see available apps
Use as Git Submodule
Add this package to your repository as a submodule:
# Add as submodule
git submodule add <repo-url> pacage-deploy
# Clone with submodules
git clone --recurse-submodules <your-repo>
# Update submodule
git submodule update --remote pacage-deploy
License
MIT License