We are going to skip ahead in our diagram to the Develop Solution Step. We are not going to go over the entire step. But I believe this is a good time to go over controlling how solutions are pushed to Test and Production and when they are and are not allowed.
If you are following this series, the first step will be to push the solution using the pipeline into Production. Create an entry for this solution then verify the entry in the Projects table. This should be the only time we have to do this. If you are simply installing the solution in your production environment, then you can skip the verification step.
Verification step.
- With the solution in production create a new request called “Platform Project Management”
- The Flow will fail because a solution with that name already exists
- We need to manually add the Solution Name from Dev into the table
Orchestrator Build Out
- Within the Pipeline Deployment Pipeline Configuration App Navigate to the Deploy to Production Deployment Stage
- Toggle the Pre-Deployment Step Required to true
- Save and close the stage
- Within the Orchestrator Environment create a new solution called Pipeline Management
Environment Variable
- Create an Environment variable called Production Pipeline Environment
- Set the Current Environment to Production
Flow Build
- Create a new flow called 1.1 - When a request to push to production is made
- Set the trigger to Dataverse, When an action is preformed
- Create three string variables. varLeadsEmail, varCustomerEmail, and varTargetEnvName
- Create a Scope called “Scope - Deployment Information”
- Add two Dataverse Get row by ID actions and configure them as follows and one Dataverse List Rows
- Table Name - Deployment Stage Runs
- Row ID - StageRunId
- Table Name - Users
- Row ID - Created By (value)
- Table Name - Deployment Environments
- Filter the rows by the Target Environment ID
- Set the vartargetEnvName using
outputs('List_rows_-_Deployment_Environment_')?['body']?['value'][0]?['name']
- Create a Scope called Scope - Get Solution Info
- Add a Dataverse List rows from selected enviorment
- Set the Enviorment to the variable set above
- Set the table name to Power Platform Projects
- Filter the rows by the solutionid using the Artifact Name
- Add a Scope called Leads info
- Add a Dataverse get row by id from selected environment
- Set the Environment to the Environment set above
- Set the table name to Entra ID
- Set the Row ID to Project Leads GUID
outputs('List_rows_from_selected_environment_-_Production_Power_Platform_Projects')?['body']?['value'][0]?['_andy_projectlead_value']
- Set the var varLeadsEmail to the Mail of the Lead
- Add a parallel branch action then add a scope, call it Customer Info
- Add a Dataverse Get Row by ID from selected environment action
- Set the Environment to the Environment variable set above
- Set the table to Contacts
- Set the row ID to
outputs('List_rows_from_selected_environment_-_Production_Power_Platform_Projects')?['body']?['value'][0]?['_andy_projectcustomer_value']
- Set the variable varCustomerEmail to the email of the customer
- Create a Scope Called Approval Start
- Inside that Scope add another Scope Called Approval Creation
- Create a Start and wait for an approval action and format is as follows
- The name of the solution is
outputs('List_rows_from_selected_environment_-_Production_Power_Platform_Projects')?['body']?['value'][0]?['andy_projectname']
- The name of the solution is
- Add a Condition based on the outcome of the Approval. Set the is equal to “Approve”
- For the If yes path add a preform an unbound action and update it as so
- Set the StageRunID to the StageRunID within the trigger
- For the if No path add a preform an unbound action and update it as so
- Add a send email action
- Set the To to the primary email of the submitter
- Set the subject and body as follows
- Under the Scope - Get Solution Info add a parallel path and add a scope.
- Update the Scope so that it will only run if the above action has failed
- Add a send email action
- Set the To to the primary email of the submitter
- Set the subject and body as follows
Testing
To test this out we will do two things. First we will create a solution to Development and try to push it into production. When we push it, it will fail and send us an email stating we need to add it to the register. Secondly we will add a project to the PPM app in production, let it create the solution in dev, then push it all the way to production. It will send the request to the lead and if approved push it to production.