Power Apps Deployment Using ADO
Power Apps Deployment Using ADO
Template.docx
Instruction
s
Follow the Instructions provided below in <>. Delete the commentary
before saving the document.
1
©2017 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
Contents
1 Overview.............................................................................................................................................3
2 Azure Portal.........................................................................................................................................4
3 Power Platform....................................................................................................................................6
4 Azure DevOps......................................................................................................................................8
5 Creating Solution on Power Apps......................................................................................................10
6 Exporting Solution into ADO..............................................................................................................11
6.1.1 Power Platform Tool Installer............................................................................................14
6.1.2 Power Platform WhoAmI...................................................................................................14
6.1.3 Power Platform Publish Customizations............................................................................15
6.1.4 Power Platform Set Solution Version.................................................................................15
6.1.5 Power Platform Export Solution.........................................................................................16
6.1.6 Power Platform Unpack Solution.......................................................................................18
6.1.7 Command Line Script.........................................................................................................19
6.1.8 Publish Artifact Drop..........................................................................................................20
7 Importing Solution into Target Environments...................................................................................21
7.1.1 Power Platform Tool Installer............................................................................................22
7.1.2 Power Platform Import Solution........................................................................................23
2
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
1 Overview
For power apps deployment we need these three tools as pre-requisite,
1. Azure Portal
2. Power Apps portal
3. Azure DevOps
Overall steps that we will perform throughout the deployment of power apps solutions are mentioned
below,
Azure Portal: a) Register an app b) Set the API permission between Azure DevOps and Power platform
c) Create client secret d) Copy all application, tenant, secret ids for service principal connection.
Power Apps portal: a) If you have admin level access then create environments for development, testing
and production (as per requirements) b) In each environment, give the app as system administrator
permission. (app-which you registered on azure portal)
Azure DevOps: a) Create an organization b) Create project c) Initialize the azure repo d) create service
connections between your project and various environments. (Service principal ids and env URLs will
require here)
I hope you have got an idea about what we will be doing for the deployment of power apps. Now let’s
see each task one by one in detail.
3
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
2 Azure Portal
i. Go to https://portal.azure.com
ii. Click on Azure Active Directory, Search for App Registration, click New Registration.
iii. Provide the name, keep other fields with default value and click Register.
iv. Once the App is created, go to API Permissions, click Add a Permission>Select Azure DevOps
>Select delegated permissions>Check user impersonation>Add Permission
v. Again, click Add a permission > Select Power Platform Run Time Services >Select delegated
permissions>Check user impersonation>Add Permission
vi. Don’t forget to Grant Admin Consent for <tenant>
vii. These API permissions will complete the bridge between Azure DevOps and Power Platform.
Now Azure DevOps and Power Platform can communicate with each other.
4
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
viii. Now, Go to Overview>Client credentials>New Secret. Copy the value into a notepad as this will
be needed later and you won’t be able to get it once navigate away from this page.
ix. Come back to overview and copy the Application (client) ID and Directory (tenant) ID in the
same notepad. You will need these 3 values while creating service connection.
5
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
3 Power Platform
6
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
v. Click New App user>search for the App registered on azure ad>Add it and provide business unit.
Select security role as System Administrator.
vi. Repeat all the above steps for the target environment (eg Test Env), Add app and give security
role as System Administrator.
7
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
4 Azure DevOps
8
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
vii. Save the Service Connection with the name (eg DevEnv_ServiceConnection)
viii. Follow the steps ii to vi above , this time get the target environment url, create the service
connection and save as (eg TestEnv_ServiceConnection)
9
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
iii. Inside solution folder, upload your apps/cloud flows/tables/data flows/master data/chatbots etc
10
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
i. Before exporting, make sure that the power platform build tool is installed for your organization.
If not, then go to the marketplace and install it so that you will get all the build and release tasks
automatically while creating the build and release pipelines. (You can find marketplace icon in
ADO at the top beside your profile)
ii. Our first task is to bring the solution into our ADO. For this we will create one build pipeline.
iii. From the left navigation within the Project, click on Pipelines >New Pipeline>Use the Classic
Editor
iv. Select the Source as Azure Repos Git, select your Project, Repository and Branch and click
continue.
11
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
vi. Click Agent Job 1 and make sure Allow Scripts to access OAuth token is checked
vii. This is the list of tasks that you can add in your build pipeline to export the solution from power
apps to ado.
12
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
viii. You can add other jobs too. Also, you can remove some of the jobs mentioned above as per your
requirements.
ix. Now, we will see each task one by one and discuss its significance.
13
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
This task is required to be added once before any other Power Platform Build Tools tasks in build and
release pipelines. This task installs a set of Power Platform–specific tools required by the agent to run
the Microsoft Power Platform build tasks. This task doesn't require any more configuration when added
but contains parameters for the specific versions of each of the tools that are being installed.
Verifies a Power Platform environment service connection by connecting and making a WhoAmI
request. This task can be useful to include early in the pipeline, to verify connectivity before processing
begins.
14
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
Always use this task before exporting the soltion from dev env to ADO. This task make sure that it
publishes all the changes made by the dev team. In case if developers forget to publish the changes, this
task will do this job on their behalf. For saftey, always use this task before export solution task.
Select the service connection -> add env url -> make sure that you are checking the box of publish
customization as asynchronous operation.
This task updates the version of a solution. If initially the version of your solution is 1.0.0 then this task
will increment the version by 1 every time you export the solution.
15
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
This task exports a solution from a source(dev) environment into ADO. There are two ways you can
export the solution,
1. Managed solution: Here, you cannot change or edit the solution components. This is best suited
for environments like test, SIT, UAT, prod.
2. Unmanaged solution: Here, you can change or edit the solution components. This is best suited
for development environment.
Managed Solution:
Display Name- Edit name of the task and add managed word so that you can differentiate between
managed and unmanaged tasks.
Service Connection- Select environment sc from where you want to export this solution.
Environment URL- Add this command $(BuildTools.EnvironmentUrl). This command will connect to
the source environment from where you are exporting this solution.
Solution Name- Firstly, in varaibles section add name and value. Name- SolutionName and Value-
the name of the solution which you will copy from power apps portal. Now, Add this command $
16
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
(SolutionName). This task will take the correct solution that you specified in variables from the
source environment.
Solution Output File- Give specific path to your solution. Here you will add that folder path where
you want to export the solution. Add this command
$(Build.StagingDirectory)/$(SolutionName)/Managed_managed.zip
Unmanaged solution:
Task details are exactly same as mentioned above for managed solution. Only change that you will
make is, Uncheck the export as managed solution. This will export an unmanaged solution into a
target folder that you will sepicify in solution output file section. $(Build.StagingDirectory)/$
(SolutionName)/Unmanaged_unmanaged.zip
Created unmanaged folder under solution name and adding unamanged zip as a name to
differentiate between managed and unmanged zip files.
17
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
Takes a compressed solution file and extracts it into multiple XML files so that these files can be more
easily read and managed by a source control system.
Solution Input File- To unpack the solution, this job will take the zip file which you just exported in
previous job. Hence here, we must mention the path of the file which we want to unpack.
Target Folder to Unpack- Where you want to unzip or unpack the solution? Accordingly, mention the
path of your target folder where you will extract all the files from the solution.
18
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
Use this task to run a command line script using Bash on Linux, macOS, and cmd.exe on Windows. This
task will push all the code and files to azure repo.
19
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
Use this task in a build pipeline to publish build artifacts to Azure Pipelines, TFS, or a file share.
Specifies whether to store the artifact in Azure Pipelines (Container), or to copy it to a file share (File
Path) that must be accessible from the build agent.
20
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
List of tasks
21
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
This task is required to be added once before any other Power Platform Build Tools tasks in build and
release pipelines. This task installs a set of Power Platform–specific tools required by the agent to run
the Microsoft Power Platform build tasks. This task doesn't require any more configuration when added
but contains parameters for the specific versions of each of the tools that are being installed.
22
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
Service Connection- Select environment sc where you want to import this solution.
Environment URL- Add this command $(BuildTools.EnvironmentUrl). This command will connect to
the target environment where you are importing this solution.
Solution Inutput File- Here, add the path where your solution zip file is located. Add this command $
(Build.ArtifactStagingDirectory)/$(SolutionName)/Unmanaged_unmanaged.zip
23
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
1) In Power platform apps go to settings --> admin center --> Environment --> New
24
©2015 Accenture. All Rights Reserved
Power Apps Deployment Using Azure DevOps Document
25
©2015 Accenture. All Rights Reserved