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 Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,149)