Hey folks, have you ever tried to understand how this PowerApps portal app works and what is the structure of the project inside it? Earlier it was not possible to download and view the complete file structure of a portals app. But now we can download and made changes directly inside the solution, and after making changes we can upload this solution back to the power apps to view the new changes directly in the browser. So, isn’t it interesting?
Let’s check out how we can do that.
Prerequisite
- Download Microsoft Power Platform CLI (you can use this link to download and setup the CLI)
- Visual Studio Code (Optional you can use any IDE)
- Microsoft Power Apps License with admin credentials
After successful setting up the environment, we can perform the steps to download the PowerApps portal app solution locally on our machine.
Step 1 - Connecting to environment
pac auth create --url https://xyz.crm8.dynamics.com/
It will open the AAD dialog box where you can login using your power apps credentials.
Step 2 - Get the details of the portal apps.
pac paportal list
It will list all the portal apps inside your selected environment.
Copy the websiteID from the above screen of the app which you want to download.
Step 3 - Download the solution.
pac paportal download --path ./ --websiteID <websiteID>
-path: Path where you want to download the solution
-websiteID: Id of the power apps portals app which you want to download.
After executing the command you will be able to see the screen where the solution is being downloaded.
As we have downloaded the solution so now, we can make changes inside solution like you can write your own HTML on the webpages.
Example
Let’s change the header of the home page as you can see in the above image. So, to do that open the downloaded solution inside visual studio code. Then navigate to Home.en-US.webpage.copy.html file.
Change the highlighted tag value with the text which you want to display as Header on the homepage.
After changes, the file will look like this.
Now we have added a bit of customization on the home page. We can upload this solution again to the power apps environment to update the portals content.
So, to do that we can execute the following command,
Command
pac paportal upload --path ./contoso-story---contoso-story
Here, we have to pass the path of the portal solution which you downloaded earlier after you made few changes.
After execution of the above command the solution will be uploaded to the power apps environment. The upload process will look something like this.
Now we have successfully uploaded the solution, we can verify the changes by running the portal apps directly in the browser so that you can see the new changes which you have made inside the portal solution.
Final Result
Conclusion
We successfully downloaded the portal solution to our local machine, made a few changes to the webpages, and lastly, we uploaded this solution with our new changes to the power apps environment.
References