pac cli admin

This post is part of the PacCLI series.


pac admin create-servce-principal has already been discussed in one of the previous posts.

But you can do a lot of other admin tasks with pac admin as well. Let’s have a look and group the commands.

Environment tasks

To manage your environments, you can combine the pac admin command with following elements:

  • list lists all environments in your tenant.
  • create creates a new dataverse environment in your tenant
  • backup Manual backup of selected environment
  • set-backup-retention-period Manual backup of selected environment
  • delete deletes environment from your tenant
  • reset reset the environment iny our tenant.
  • list-backups Lists all backups for your environment.
  • restore restores an environment based ona specific backup.
  • copy copies a source environment to target environment.
  • status status of all processes will be shown.

pac admin create help will provide you the list of all required and possible configuration options. During the creation of the environemtn you have to take some decisions. Some of them have a predefined value, so i you do not want to specify something else, you can leave these options blank. But remembetr, once set, you can only change, sometimes if you reset the environment, and seomtimes only when you delete and recreate the envionment with the correct settings.

You definitely have to specify the namen (-n) and type (-t) of the environment. I will use type “Developer” in this example. Region (-r), Currency (-c) and Language (-l) are predefined with values correct for the US market. If you need to change these, just enter the respective variables.

Other options that are available during the creation of an environments are the security-group-id (-sgid), async (-a), max-async-wait-time (-wt), templates (-tm) with whom you can define which Dynamics 365 Applications should be installed and the user (-u). The User will allow you to specify the owner of the environment and can also be an AppId.

All these values can also be stored as json in an input-file (-if). So, the easiest way to create a new Developer environment will be:

pac admin create -n Dev -t Developer

Quicktip

If you don’t know e.g., the correct variable for a specific value, enter the mandatory values and a wrong one for the one that you do not know. I tried earlyaccess for region, but the correct one will be unitedstatesfirstrelease. When I entered the wrong valuem I received the error with explanation and possible correct values.

Regions:
‘unitedstates, unitedstatesfirstrelease, europe, asia, australia, india, japan, canada, unitedkingdom, southamerica, france, unitedarabemirates, germany, switzerland, norway, korea’

Currency:
AED, AFN, ALL, AMD, ARS, AUD, AZN, BAM, BDT, BGN, BHD, BND, BOB, BRL, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUP, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, GBP, GEL, GTQ, HKD, HNL, HTG, HUF, IDR, ILS, INR, IQD, IRR ,ISK, JMD, JOD, JPY, KES, KGS, KHR, KRW, KWD, KZT, LAK, LBP, LKR, LYD, MAD, MDL, MKD, MMK, MNT, MOP, MVR, MXN, MYR, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SEK, SGD, SOS, SYP, THB, TJS, TMT, TND, TRY, TTD, TWD, UAH, USD, UYU, UZS, VES, VND, XAF, XCD, XDR, XOF, YER, ZAR

Language:
Sorry, I will not provide the list of language codes here, as I am absolutely convinced that the base language should be English in every environment, as this is also the fallback language.

Templates
To get the list of all available templates you have to run pac admin list-app-templates D365_CDSSampleApp Sample App D365_CustomerService Customer Service D365_CustomerServicePro Customer Service D365_DeveloperEdition Developer Edition D365_FieldService Field Service D365_Guides Guides D365_PowerFrameworkTemplate Power Framework D365_ProjectOperations Project Operations D365_RemoteAssist Remote Assist D365_Sales Sales Enterprise D365_SalesPro Sales Pro D365_SmbMarketing SMB Marketing

Other admin commands

pac admin list-tenant-settings This command will run without any additional information and will provide you all tenat settings in a json formatted way. Slect everything, copy it and as you might be in vscode already create a new settings.json file and paste the tenant settings.

Now you can make some changes to the settings and use the next command to upload the settings.json to the enant. pac admin update-tenant-settings -s settings.json

Governance: pac admin set-governance-config will provide you the following list with all kind of different governance settings that you can apply with pac cli:

–environment URL or GUID of environment (Alias: -env) –protection-level define protection level: „Standard“, to actibvate managed environments, „Basic“, to deactivate (Alias: -pl) –disable-group-sharing Deactivate group sharing. (Alias: -dgs) –exclude-analysis exclude environment analysis from weekly Digest-E-Mail aus. (Alias: -ea) –include-insights include insights in Power Platform Admin Center Home Screen Cards. (Alias: -ii) –limit-sharing-mode limit sharing. (Alias: -lsm) –max-limit-user-sharing Wif group sharing is deactivated, define the max number of persons a Canvas Makes can share with (Alias: -ml) –solution-checker-mode Solution Checker Mode (Alias: -scm), Values: none, warn, block –maker-onboarding-url URL for dev onboarding (Alias: -mou) –maker-onboarding-markdown Markdown for dev Onboarding (Alias: -mom) –suppress-validation-emails Suppress email validation (Alias: -sve) –checker-rule-overrides check rules for solution overriding (Alias: -cro) –cloud-flows-mode Solution-Cloud-Flows limit sharing mode (Alias: -cfm) –cloud-flows-limit Number of persons, for whom dev can share Solution-Cloud-Flows(Alias: -cfl)


All parts of this series (7)

  1. 1. pac cli Tools
  2. 2. pac canvas
  3. 3. pac cli admin
  4. 4. pac cli Service Principal
  5. 5. pac cli list environments
  6. 6. Authenticate pac cli
  7. 7. Introduction to pac cli