You are currently viewing Power Pipelines and Enhanced ALM Part 5 – Controlling Pushes to Production

Power Pipelines and Enhanced ALM Part 5 – Controlling Pushes to Production

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.

  1. With the solution in production create a new request called “Platform Project Management”
  2. The Flow will fail because a solution with that name already exists
  3. We need to manually add the Solution Name from Dev into the table

Orchestrator Build Out

  1. Within the Pipeline Deployment Pipeline Configuration App Navigate to the Deploy to Production Deployment Stage
  2. Toggle the Pre-Deployment Step Required to true
  3. Save and close the stage
  4. Within the Orchestrator Environment create a new solution called Pipeline Management

Environment Variable

  1. Create an Environment variable called Production Pipeline Environment
  2. Set the Current Environment to Production

Flow Build

  1. Create a new flow called 1.1 - When a request to push to production is made
  2. Set the trigger to Dataverse, When an action is preformed
  3. Create three string variables. varLeadsEmail, varCustomerEmail, and varTargetEnvName
  4. Create a Scope called “Scope - Deployment Information”
  5. Add two Dataverse Get row by ID actions and configure them as follows and one Dataverse List Rows
    1. Table Name - Deployment Stage Runs
    2. Row ID - StageRunId
    3. Table Name - Users
    4. Row ID - Created By (value)
    5. Table Name - Deployment Environments
    6. Filter the rows by the Target Environment ID
    7. Set the vartargetEnvName using
      outputs('List_rows_-_Deployment_Environment_')?['body']?['value'][0]?['name']
  6. Create a Scope called Scope - Get Solution Info
  7. Add a Dataverse List rows from selected enviorment
    1. Set the Enviorment to the variable set above
    2. Set the table name to Power Platform Projects
    3. Filter the rows by the solutionid using the Artifact Name
  8. Add a Scope called Leads info
  9. Add a Dataverse get row by id from selected environment
    1. Set the Environment to the Environment set above
    2. Set the table name to Entra ID
    3. Set the Row ID to Project Leads GUID
      outputs('List_rows_from_selected_environment_-_Production_Power_Platform_Projects')?['body']?['value'][0]?['_andy_projectlead_value']
  10. Set the var varLeadsEmail to the Mail of the Lead
  11. Add a parallel branch action then add a scope, call it Customer Info
  12. Add a Dataverse Get Row by ID from selected environment action
    1. Set the Environment to the Environment variable set above
    2. Set the table to Contacts
    3. Set the row ID to
      outputs('List_rows_from_selected_environment_-_Production_Power_Platform_Projects')?['body']?['value'][0]?['_andy_projectcustomer_value']
  13. Set the variable varCustomerEmail to the email of the customer
  14. Create a Scope Called Approval Start
  15. Inside that Scope add another Scope Called Approval Creation
  16. Create a Start and wait for an approval action and format is as follows
    1. The name of the solution is
      outputs('List_rows_from_selected_environment_-_Production_Power_Platform_Projects')?['body']?['value'][0]?['andy_projectname']
  17. Add a Condition based on the outcome of the Approval. Set the is equal to “Approve”
  18. For the If yes path add a preform an unbound action and update it as so
  19. Set the StageRunID to the StageRunID within the trigger
  20. For the if No path add a preform an unbound action and update it as so
  21. Add a send email action
    1. Set the To to the primary email of the submitter
    2. Set the subject and body as follows
  22. Under the Scope - Get Solution Info add a parallel path and add a scope.
  23. Update the Scope so that it will only run if the above action has failed
  24. Add a send email action
    1. Set the To to the primary email of the submitter
    2. 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.

Leave a Reply