Did you know that you can install a specific application in your Power Platform environment using pac application commands?

Let me explain why installing applications is necessary. In one of our requirements, we needed to pre-install the Power Automate Approvals on the environment before installing our Power Apps application.

If you’re wondering why we need to concern ourselves with the availability of Power Automate Approvals on any environment, assuming it should be available by default, please note that – “The Power Automate Approvals feature is configured on-demand the first time any approval flow runs in an environment and executes the “Create an Approval” or “Start and wait for an approval” steps”.

In this article, I will demonstrate how to install an application using pac application commands.

Before we delve into using pac application commands, , let’s first ensure that we have the prerequisites ready.

Prerequisites:

  • Install the Microsoft Power Platform CLI, if not installed already.
  • Ensure you have the latest ‘pac’ version installed by executing the pac install latest command.
  • Complete the ‘Sign in’ process, and you should see a profile created as shown below.
  • pac application commands require the ‘Environment ID‘ of the environment where you want to install the applications.

Now that we have the latest ‘pac’ installed, let’s proceed with the using pac application commands.

pac application list command :

  • To get the list of all available applications in your environment, trigger the pac application list command, as shown below.
    • Use the ‘Environment ID‘ copied in the prerequisites section.
pac application list --environment ebb51434-39ed-e71a-8aa0-42033d9afb13
  • You can also, lists all available applications for the tenant you’re connected to and saves it as a JSON file in the directory, using following command.
pac application list --output {path_to_applicationslist.json}
  • applicationslist.json‘ file gets stored locally, as shown below.

As seen above, the pac application list command lists all available applications in the specified environment. To install a specific application in your environment, use the pac application install command.

pac application install command:

pac application install --environment ebb51434-39ed-e71a-8aa0-42033d9afb13 --application-name msdyn_FlowApprovals
  • You can also install a list of applications in a JSON file in a specified environment using:
pac application install --environment-id 00000000-0000-0000-0000-000000000000 --application-list {path_of_applicationslist.json}
  • Follow the steps mentioned in the above section to generate the applicationslist.json file.

Hope you gained the knowledge on how to use the pac application commands to either list of install a Dataverse application into your environment.

🙂

Advertisements
Advertisements

Leave a comment