Power Platform Command Line Interface: October Updates

ShafQat Nizar

We’re excited to announce the new updates released in Power Platform CLI October updates. There are a number of improvements that we have made for you, our developer community, and we want to share with you to help overcome roadblocks and make process enhancements. The team is thankful for your continued support.

Canvas app download

In our previous release of Power Platform CLI, we had shared updates related to the pac canvas list and pac canvas download for your .msapp file. We are continuing to improve this process but now having an additional property --extract-to-directory to extract your .msapp file (Canvas application) to a specific folder.

A developer can use below command to download Canvas .msapp file and extract the .msapp file into a chosen directory to take a peek at the artifacts.

pac canvas download --name <canvas_app> --extract-to-directory <destination_folder>

Please do note that --extract-to-directory argument is not to be confused with pac canvas unpack functionality.

Why, because when we use --extract-to-directory argument, it will automatically extract the .msapp file to look at the raw artifacts but when we use pac canvas unpack, where pack/unpack are preview/experimental commands, we will convert to an alternate format. Now, look at the image below where we have extracted the .msapp file.

Image canvas download

Power Fx capability with an alias

We heard from number of our community members for having an alias to use when invoking Power Fx capability. Now, instead of typing pac power-fx repl, you can simply use pac pfx repl.

We have also updated our documentation to share what Power Fx functionality can be used in Power Fx capability within Power Platform CLI. This updated link is now available within REPL when used “Help()” function.

We have listed the link at the bottom of the function list (see in the below image): A specific REPL function list https://aka.ms/Power-Fx-PAC-CLI 

Power-Fx using PFX alias and function list help.

Don’t forget to review our functions list as we are constantly adding support for additional Power Fx functions into this capability within Power Platform CLI.

Security Token Cache improvement in pac auth

Power Platform CLI should be auto upgrading the token cache to the new format, so there should not be a mismatch. However, there is an edge case, that is:

  • If you use the new version of Power Platform CLI
  • Switch to an older version of Power Platform CLI
  • Create a profile with the old version
  • Use the new version of Power Platform CLI
  • The new version won’t have the token, as the upgrade process has already run.

Thinking of security improvements within Power Platform CLI, we are now providing additional features of utilizing Token Cache with “pac auth”. If you want to learn more about authentication profiles, check this post.

Update into data import capability

Prior to this improvement, if your import had failed there was no details provided where one could easily look for an error. Now we have made an update so that the process will return a non-zero return code if an import fails. This will helps speed up the resolution of the failure.

Long path names support

We are happy to share that we are now supporting long path names in Power Platform CLI on Windows. For instance, when working with solutions, you might have a long path name where your solution is stored, such as pac solution clone, one can use a long path name (path limitations).

pac solution clone --name MMC_test --outputDirectory "\\?\c:\Very_Long_Path"

Image LongPathNames 2

Package deployer using --solution argument

I want to note here that in order to use the package deployer, it is required that one must have the Full .NET Framework version of the Power Platform CLI where “Full .NET Framework” implies that it’s Windows only.

We have added a new --solution argument which adds the ability to pass a solution to package deployer to deploy the solution. This will allow the package deployer processor to support async, retry, timeout and other features that it uses to deliver a solution to an environment.

You can use below command to utilize the --solution argument.

pac package deploy --solution SolutionFile.zip

Image package deploy

Security Group ID in pac admin create using --security-group-id

Now for this update, we have been hearing requests from our developer community for this improvement when creating an environment, they want to be able to use a security group. Now you can do that by simply providing the Microsoft Entra ID Security Group when using pac admin create with a --security-group-id property.

Please note that the security group ID must be a valid GUID.

You can get you security group id from Azure portal but going to Azure Active Directory (Microsoft Entra ID) –> select Groups in the left blade, you will see the screen below.

Image GUID

Using Unique solution name in pac pcf push with --solution-unique-name

With the addition of --solution-unique-name argument (mutually exclusive with --publisher-prefix argument), one can now add the component using the unique name of the solution. When using the target environment, which is now supported, the temporary solution (and the temporary publisher) and the publisher prefix from the target environment will be deleted after an import is successful. You can get the solution unique name by using the pac solution list command and the first column in the output is the unique name (see below).

Image solution unique name

Admin capabilities for application register and unregister

Let me not forget about pac admin application register and pac admin application unregister. Previously one would have to use PowerShell to register applications and there was no command line option to unregister.

Imagine you have an application, model-driven application in this case, and you want to alter roles for this application that is an administration operation, but you are not able to do so from the Power Platform CLI because you have not registered this application and is not visible in the list. First you will need to get the application ID, which you can get the application ID from the UI or the link (highlighted below).

Image AppRegUnreg

What commands are available with pac admin application, well you can list, register, and unregister applications for your tenant, that are.

Image AppRegUnreg 2

Now, you would need to use below command to register the application using the application ID from previous step. When you list the application using pac admin application list, you are not seeing the application ID in the list. After you run below register command, and then list the application, you will see the application ID in the list.

pac admin application register --application-id <application_id>

Image AppRegUnreg 3

Once we no longer have a need for the application, we can unregister the application and it will be removed from the list of applications where an administration operation can be performed. We use below command to unregister and upon unregistering, you can see that it will disappear from the list below.

pac admin application unregister --application-id <application_id>

Image AppRegUnreg 4

Now we are happy to share that you can register and unregister application right from the Power Platform CLI by using one of the below commands and feel free to visit our documentation on these.

pac admin application register --application-id <application_id>

pac admin application unregister --application-id <application_id>

Power Virtual Agent bots updates (recently renamed to Microsoft Copilot Studio)

For our developers using Power Virtual Agent bots and want to manage their bots via Power Platform CLI, we have added the ability to extract & merge files with localized content and the ability to extract a template file from an existing bot assuming the bot is part of an environment. Here is a link to our documentation for additional arguments to be used.

To demonstrate the ability, I created a sample bot in my developer environment. Below I am going to share by listing the bots in my environment that I am connected to. I will then use below command to extract a template file from the bot I created.

pac virtual-agent extract-template --bot <Chatbot_ID> --templateFileName <YAML_template_file> 

Image pva 2

Below commands can be used to extract and/or merge files with localized contents.

Details

We are so excited to get these updates rolled out, we hope you enjoy these new updates, and we are looking forward to hearing from you. As you try out these updates, please continue to provide your feedback at the following location: https://aka.ms/pac/feedback.

Also, don’t forget to join our Monthly Power Platform Developer Office Hours. You can find more information at https://aka.ms/ProDevCommunity.

Please note that we will NOT have any office hours during the month of December but please continue to provide your valuable feedback!

Thank you!

0 comments

Discussion is closed.

Feedback usabilla icon