Connecting Azure DevOps pipelines to PowerApps env
In order to be connected to the APSD Power Apps environments through Azure DevOps, an app registration must be created in Azure Portal first. Once that is created, there are then two parts to hooking up DevOps to PowerApps environments: (1) Creating the service connection in DevOps (2) Adding it as an application user in PowerApps. A service connection will be required when we create a pipeline or set up up any other automated task through Azure.
Part 1. Create a service connection in DevOps
Click on the Project settings at the left bottom corner.
Click on Service connections
Click on New service connection top right corner
In the search box type, power and select the Power Platform --> click Next
Enter all the required information under the 'New Power Platform service connection as shown in the picture. This information can be found from Azure portal. You will need to have the Server URL, Tenant ID, Application ID and Client secret of Application ID. Please see RDIMS #17999814 for all the information needed for client secret.
Under the Service connection name provide the name of the application with the environment name.
Lastly, check the Grant access permission to all pipelines.
Part 2. Add an application user in PowerApps
Go to the Power app platform for the environment you are setting up, then click on the wheel to the right of it → select Admin center
Click on the environment you are setting the connection for in our example it is the qa
Click on S2S Apps See all (on the right end side under Access)
Set up a new application user
Click on the plus to add an app
In the search box start typing Civil Aviation and it should bring the option to select
Click on the Civil Aviation to add it as an app from Azure Active Directory → then click Add
Under Business unit open the drop down and you should see the sandbox that is associated with the environment you are trying to setup.
Under Security roles click on edit pencil icon → Scroll down and add the System Customizer Role to this app user → Click Save.
You should now be able to create the new app user by clicking create
Test your connection in Azure through the pipeline.
If you get an error on the build “[error]Failed to connect to Dataverse”, this means a new app user needs to be added in the Power Apps environment. Follow Part 2 to resolve this error.
Related articles
https://docs.microsoft.com/en-us/power-platform/alm/devops-build-tools