This guide demonstrates the complete workflow from analyzing existing solutions to generating and deploying Power Automate flows to Dynamics 365/Power Platform environments.
You now have a complete Power Platform automation toolkit with two specialized agents:
- Analyzes patterns from existing solutions
- Generates production-ready Power Automate flows
- Creates complete JSON definitions with proper structure
- Outputs comprehensive documentation
- Deploys flows to Power Platform environments
- Manages solution packaging and versioning
- Handles connection references and authentication
- Generates deployment scripts and CI/CD configurations
localFirstTools3/
βββ temp_solutions/ # Analyzed solution patterns
β βββ MSFT_Innovation/
β β βββ Workflows/*.json # Reference flows
β βββ RnD_Copilot/
β β βββ Workflows/*.json # Reference flows
β βββ deployments/ # Deployment workspace
β
βββ generated_flows/ # Generated flows ready for deployment
β βββ AutomatedMeetingNotesEmailer.json # Flow definition
β βββ AutomatedMeetingNotesEmailer_README.md
β βββ DEPLOYMENT_PACKAGE.md
β βββ test_flow.sh
β
βββ .claude/agents/ # Agent configurations
βββ power-automate-flow-generator.md
βββ power-platform-deployer.md
Analyzed Solutions:
- β
MSFTAIBASInnovationTeam_1_0_0_1.zip - β
MSRNDCopilotAssistantPOC_1_0_0_1_managed.zip - β
RnDSFRCopilot.zip
Patterns Extracted:
- Email automation (Parse JSON β Send Email)
- Copilot integration (Email trigger β Execute Copilot)
- HTTP/API integration (Skills trigger β HTTP β Response)
- Salesforce queries
- Meeting management workflows
Example - Generate a New Flow:
# Invoke power-automate-flow-generator agent
"Generate a Power Automate flow that automatically creates SharePoint list items from Teams channel messages"What the Agent Does:
- Analyzes requirement against known patterns
- Selects appropriate trigger (Teams message posted)
- Configures actions (Parse message β Create SharePoint item)
- Generates complete JSON with proper schema
- Creates documentation and test files
- Outputs to
generated_flows/directory
Example - Already Generated:
- β
AutomatedMeetingNotesEmailer.json- Ready for deployment
Check Prerequisites:
# Verify pac CLI is installed
pac --version
# Should show: Microsoft PowerPlatform CLI Version: 1.x.xIf not installed:
# macOS
brew tap microsoft/powerplatform-cli
brew install powerplatform-cli
# Windows
winget install Microsoft.PowerPlatformCLI
# Linux
dotnet tool install --global Microsoft.PowerApps.CLI.ToolExample Deployment Commands:
# Invoke power-platform-deployer agent
"Deploy AutomatedMeetingNotesEmailer to my test environment"Agent Execution Flow:
- β Checks pac CLI installation
- β Verifies authentication to Power Platform
- β Analyzes flow requirements (Office 365 connector)
- β Creates or selects target solution
- β Packages flow into solution structure
- β Validates connection availability
- β Imports solution to target environment
- β Configures connection references
- β Enables flow
- β Generates deployment report
"Generate a deployment script for AutomatedMeetingNotesEmailer that can run in Azure DevOps"Agent Output:
- Bash deployment script with error handling
- Azure DevOps YAML pipeline
- Connection mapping configuration
- Rollback instructions
"Promote AutomatedMeetingNotesEmailer from dev to test to production"Agent Process:
- Export from dev (unmanaged solution)
- Import to test environment
- Validate and test
- Export managed solution from test
- Import to production (managed)
- Document version across environments
pac auth create --url https://yourorg.crm.dynamics.com
# Opens browser for OAuth loginpac auth create \
--kind SERVICEPRINCIPALSECRET \
--url https://yourorg.crm.dynamics.com \
--applicationId <app-id> \
--clientSecret <secret> \
--tenant <tenant-id>Required Azure AD App Permissions:
- Dynamics CRM user_impersonation
- PowerApps API access
pac auth create \
--url https://yourorg.crm.dynamics.com \
--username user@domain.com \
--password <password># Step 1: Generate flow
"Create a flow that sends daily summary reports via email"
# Step 2: Deploy to dev
"Deploy the generated flow to development environment"
# Step 3: Promote to production
"Promote the flow from dev to production"# Generate complete CI/CD setup
"Create an Azure DevOps pipeline to deploy all flows in generated_flows/ directory"Agent Output:
azure-pipelines.yml- Pipeline configurationdeploy.sh- Deployment scriptrollback.sh- Rollback scriptconnection-config.json- Connection mappingREADME.md- Pipeline setup instructions
"Deploy all flows from generated_flows/ to test environment"Agent Process:
- Discovers all .json files in generated_flows/
- Analyzes each flow's requirements
- Creates consolidated solution
- Deploys as single package
- Configures all connections
- Generates comprehensive report
"Export all flows from production and generate documentation"Agent Output:
- Exported solution packages
- Flow documentation for each flow
- Connection reference mapping
- Environment comparison report
# Generate flow using custom connector
"Create a flow that uses the custom BusinessInsightBot connector to query data"
# Deploy with custom connector setup
"Deploy to test and configure the BusinessInsightBot connector"# Generate flow with multiple dependencies
"Create a flow that triggers another flow and sends results to SharePoint and Teams"
# Deploy with dependency resolution
"Deploy with all dependencies to production"# Generate flow with environment-specific values
"Create a flow that uses environment variables for API endpoints"
# Deploy with environment-specific configuration
"Deploy to production and configure environment variables"| Feature | Interactive | Dry-Run | Unattended | Multi-Env |
|---|---|---|---|---|
| User Prompts | β Yes | β Yes | β No | |
| Executes Changes | β Yes | β No | β Yes | β Yes |
| Generates Scripts | β Yes | β Yes | β Yes | |
| Rollback Plan | β Yes | β Yes | β Yes | β Yes |
| CI/CD Ready | β No | β Yes | β Yes | |
| Best For | First deploy | Testing | Automation | ALM |
# 1. Check flow appears in environment
pac flow list --environment <env-id>
# 2. Verify flow is enabled
pac flow show --flow-id <flow-id> --environment <env-id>
# 3. Test manual trigger flow
curl -X POST "FLOW_TRIGGER_URL" \
-H "Content-Type: application/json" \
-d @generated_flows/sample_payload.json
# 4. Check run history in Power Automate portal
open "https://make.powerautomate.com"Power Platform Admin Center:
- Monitor flow runs:
https://admin.powerplatform.microsoft.com - Check connection health
- Review error logs
- Track performance metrics
Azure Application Insights:
- Integrate flows with App Insights
- Track custom events
- Set up alerts
- Analyze trends
Solution:
# Install pac CLI
brew install microsoft/powerplatform-cli/pac
# or
dotnet tool install --global Microsoft.PowerApps.CLI.ToolSolutions:
# Clear and recreate auth
pac auth clear
pac auth create --url https://yourorg.crm.dynamics.com
# Verify authentication
pac org who
# Check permissions
# User needs System Administrator or System Customizer roleSolutions:
- Verify connector name:
pac connector list - Install connector from AppSource
- Enable connector in admin center
- Check license requirements
Solutions:
- Create connection manually in Power Automate portal
- Use connection mapping file during deployment
- Configure connections after import
- Verify connection owner has permissions
Solutions:
# Check solution dependencies
pac solution list
# Import with force overwrite
pac solution import --path solution.zip --force-overwrite
# Check for duplicate components
# Verify solution version is incremented-
Flow Definition
- Location:
generated_flows/AutomatedMeetingNotesEmailer.json - Format: Microsoft Logic Apps schema
- Contains: Triggers, actions, connection references
- Location:
-
Flow Documentation
- Location:
generated_flows/AutomatedMeetingNotesEmailer_README.md - Contains: Architecture, configuration, testing guide
- Location:
-
Deployment Guide
- Location:
generated_flows/DEPLOYMENT_PACKAGE.md - Contains: Step-by-step deployment instructions
- Location:
-
Visual Diagrams
- Location:
generated_flows/FLOW_DIAGRAM.md - Contains: Architecture diagrams, data flow
- Location:
# Authentication
pac auth list # List auth profiles
pac auth create --url <url> # Create auth
pac auth select --index <n> # Switch profile
pac org who # Show current user
# Solutions
pac solution list # List solutions
pac solution export --name <name> # Export solution
pac solution import --path <path> # Import solution
pac solution init # Initialize solution
# Flows
pac flow list # List all flows
pac flow show --flow-id <id> # Show flow details
pac flow enable --flow-id <id> # Enable flow
pac flow disable --flow-id <id> # Disable flow
pac flow export --flow-id <id> # Export flow
# Connectors & Connections
pac connector list # List connectors
pac connection list # List connections
pac connection create --connector <n> # Create connection
# Environment
pac org list # List environments
pac org select --environment <id> # Select environment-
Generate flows in dev environment
- Test locally first
- Use unmanaged solutions
- Iterate quickly
-
Validate in test environment
- Deploy as unmanaged
- Test with production-like data
- Verify performance
-
Deploy to production as managed
- Export managed solution
- Deploy during maintenance window
- Monitor closely after deployment
# Git workflow for flows
git add generated_flows/*.json
git commit -m "feat: add automated meeting notes emailer flow"
git tag v1.0.0
git push origin main --tags
# Solution versioning
# Use semantic versioning: MAJOR.MINOR.PATCH.BUILD
# Example: 1.0.0.1 β 1.0.0.2 (bug fix)
# 1.0.0.2 β 1.1.0.0 (new feature)
# 1.1.0.0 β 2.0.0.0 (breaking change)-
Never commit secrets
- Use environment variables
- Store in Azure Key Vault
- Use managed identities
-
Use service principals for CI/CD
- Create dedicated app registration
- Assign minimum required permissions
- Rotate secrets regularly
-
Audit deployments
- Log all operations
- Track who deployed what when
- Maintain rollback capability
# Test flow locally (if possible)
./generated_flows/test_flow.sh
# Deploy to dev first
"Deploy to development environment"
# Run integration tests
# Verify with sample data
# Deploy to test
"Promote to test environment"
# Run full test suite
# Load testing, security testing
# Deploy to production
"Promote to production with managed solution"# azure-pipelines.yml
trigger:
branches:
include:
- main
paths:
include:
- generated_flows/*.json
pool:
vmImage: 'ubuntu-latest'
variables:
- group: PowerPlatform-Credentials
steps:
- task: PowerPlatformToolInstaller@2
displayName: 'Install Power Platform CLI'
- bash: |
pac auth create \
--kind SERVICEPRINCIPALSECRET \
--url $(POWER_PLATFORM_URL) \
--applicationId $(SERVICE_PRINCIPAL_ID) \
--clientSecret $(SERVICE_PRINCIPAL_SECRET) \
--tenant $(TENANT_ID)
displayName: 'Authenticate to Power Platform'
- bash: |
# Deploy using power-platform-deployer agent
# (invoke through Claude Code or custom script)
displayName: 'Deploy Flows'
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: 'deployment_report.md'
artifactName: 'deployment-report'# .github/workflows/deploy-flows.yml
name: Deploy Power Automate Flows
on:
push:
branches: [main]
paths:
- 'generated_flows/*.json'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install pac CLI
run: |
dotnet tool install --global Microsoft.PowerApps.CLI.Tool
- name: Authenticate
env:
POWER_PLATFORM_URL: ${{ secrets.POWER_PLATFORM_URL }}
SERVICE_PRINCIPAL_ID: ${{ secrets.SERVICE_PRINCIPAL_ID }}
SERVICE_PRINCIPAL_SECRET: ${{ secrets.SERVICE_PRINCIPAL_SECRET }}
TENANT_ID: ${{ secrets.TENANT_ID }}
run: |
pac auth create \
--kind SERVICEPRINCIPALSECRET \
--url $POWER_PLATFORM_URL \
--applicationId $SERVICE_PRINCIPAL_ID \
--clientSecret $SERVICE_PRINCIPAL_SECRET \
--tenant $TENANT_ID
- name: Deploy Flows
run: |
# Deployment script here
echo "Deploy flows"
- name: Upload Report
uses: actions/upload-artifact@v3
with:
name: deployment-report
path: deployment_report.md- β Flow appears in target environment
- β Flow state is "Started" (enabled)
- β All connection references configured
- β Test run completes successfully
- β No errors in run history
- β Deployment report generated
- β Rollback plan available
- Flow run success rate (target: >95%)
- Average execution time
- Error rate and types
- Connection failures
- Throttling incidents
-
Test the workflow:
"Deploy AutomatedMeetingNotesEmailer to my test environment" -
Generate another flow:
"Create a flow that archives completed tasks to SharePoint" -
Create deployment pipeline:
"Generate Azure DevOps pipeline for continuous deployment"
- Automated testing framework
- Flow performance optimization
- Custom connector generation
- Solution dependency analyzer
- Environment comparison tool
- Automated rollback on failure
- Multi-region deployment
- Flow usage analytics
- power-automate-flow-generator: Generate flows from patterns
- power-platform-deployer: Deploy flows to environments
- Power Platform Community Forums
- Power Automate User Group
- GitHub Power Platform samples
You now have a complete end-to-end automation workflow:
- β Solution Analysis - Patterns extracted from 3 solutions
- β Flow Generation - Automated flow creation with documentation
- β Deployment Ready - pac CLI integration for environment deployment
- β CI/CD Support - Pipeline generation and automation scripts
- β Best Practices - Security, versioning, testing built-in
Start deploying flows to Power Platform today!
# Quick start command
"Deploy AutomatedMeetingNotesEmailer to test environment"Last Updated: October 14, 2025 Version: 1.0.0 Maintained by: Claude Code Power Platform Agents