Showing results for 
Search instead for 
Did you mean: 
Post Patron
Post Patron

Automating creating a new environment: what is the best approach?

I wondered if there is a preferred way for automating creating a power platform environment ensuring


  • You have a nice vanity url!
  • Enable Dataverse as the database
  • Optionally add the CDS Apps 
  • Set the security group for the environment 

PowerShell (Install-Module -Name Microsoft.PowerApps.Administration.PowerShell)  or CLI via Power Platform tools for VSCode




New-AdminPowerAppEnvironment -DisplayName 'Test' -Description 'Test UAT for all my Apps' -ProvisionDatabase   -Location 'unitedkingdom' -EnvironmentSku Sandbox -DomainName Test




My attempt with the latter wasn't exactly successful!


Microsoft PowerPlatform CLI
Version: 1.14.2+g7205df7

Usage: pac [admin] [application] [auth] [canvas] [help] [org] [package] [paportal] [pcf] [plugin] [solution] [telemetry]

// connect to the default environment
 pac auth create --url

pac admin create -n "Test" -r "United Kingdom" -t "Sandbox" -c "British Pound" -d "Test"



Platform create error.png

Helper II
Helper II

No right and wrong here...

They both call the same engine, yet use a different interpreter. Some people like cli over PowerShell, so its more or less up to you.

If you have multiple PowerShell scripts doing stuff, using this one also from PowerShell makes the most sense.

Helpful resources

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Users online (5,585)