pac cli list environments
This post is part of the PacCLI series.
In the first posts we have installed pac cli as part of Power Platform Tools in vscode and also installed the downloadable solution. Then we have created an authentication profile. In this one, we will continue with the basics and have a look at the environment management settings in the vscode extension as well as with the pac cli command.
Have a look at the environments
When you do not see an environment, there could be different options:
- you do not have access to an environment - in this case I strongly recommend to follow first my post, how to set up your free M365 Development tenant and activate a personal dev environemt, or
- the environment you have access to, does not have dataverse enabled. Nevertheless, as will all topics, I strongly recommend to use either your dev tenant or a trial tenant to learn new functionalities and not your regular work tenant.
If you see at least one or multiple environments, click on the greater than icon to inspect an environment and see solutions which are installed in this specific environment. You will see a list of your managed and unmanaged solutions in the environment (Managed are visualized by a small clsoed lock). In addition, you can hover above the information, to get more details.
Be aware, that not all solutions are displayed in this list e.g., managed solutions of Dynamics 365 Apps by Microsoft are not shown.
If you right click on one of the environment entries, you can
- copy the Display name
- copy Environment Id or Url
- copy Organization Id as these are values that you need, when working with pac. In addition, by clicking on the small star next to the environment, you are selecting this.
Have a look at the solutions
You can also right click on the solution to
- Copy Frinedly Name
- copy Unique Name
- copy Version Number
Command line options
Instead of just working with the Power Platform Tool extension, you can as well use the pac cli command to work with the environments:
pac env
will provide you a complete list of the available options
With
pac env list
you will get a complete list of all environments where you have access. The active one will be marked with an asterisk.
If none of the listed environments is yet marked with an asterisk - no environment has been selected. You can achieve this by
pac env select -env NameOfEnvironment
.
To get even more details about the selected environment like OrgID and Owner User Email as well as User ID you can use the command
pac env who
Be careful
If you have read my posts regarding Browser Extension like Level Up already, you might be aware that there are a lot of environment specific settings. And guess what, you can read these as well with the command interface by
pac env list-settings
you will get the complete list of settings with the current values.
This is still not the part where you must be careful, this will just provide you the information.
But with
pac env update-settings -env GUID -n nameofsetting -v newvalue
pac env
you can change existing values for your environment. Just have a look at the settings and current values that you have receiverd by list-settings and then you have the name of all settings that you could update.
But as always - this is something that you should try out in a private dev or even better trial environment where you can do no harm
Automated FetchXML
In case you are working with FetchXML, then there is also an option for you. If you have e.g. a FetchXML query defined and you want to macke sure, that the information is in multiple environments - then save the query in a xml file and run
pac env fetch -env environmentGUID -xf nameoffile
All parts of this series (7)
- 1. pac cli Tools
- 2. pac canvas
- 3. pac cli admin
- 4. pac cli Service Principal
- 5. pac cli list environments
- 6. Authenticate pac cli
- 7. Introduction to pac cli
About CRM and Beyond
Jörgen Schladot
Solution Architect
Dynamics 365 CE & Power Platform
@ Avanade Deutschland GmbH
Recent Posts
Tags
Archives