Hi,
when trying to use New-AdminPowerAppEnvironment, I am getting an error:
New-AdminPowerAppEnvironment -DisplayName AutomatedTest -EnvironmentSku Trial -LocationName canada
Code : BadRequest
Description : Bad Request
Error :
Errors :
Internal : System.Net.HttpWebResponse
The same error happens with or without a call to Add-PowerAppsAccount:
$pass = ConvertTo-SecureString "<PASSWORD HERE>" -AsPlainText -Force
Add-PowerAppsAccount -Username <USER HERE> -Password $pass
Other cmdlets seem to be working. For example, I can use Get-AdminPowerAppEnvironmentLocations without any problems.
Thanks,
Alex
Ok
Please post this as a new topic. This is a very old thread and you won't get much traffic here. To get an answer please re-post.
Hi
Is PowerShell the preferred method for automating creating environments, I have been attempting to do this via the Power Platform tooling in VSCode without much success😫
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 https://org123456.crm11.dynamics.com
pac admin create -n "Test" -r "United Kingdom" -t "Sandbox" -c "British Pound" -d "Test"
Yes, figured it out at some point.. turned out we can use -Verbose switch now to get those additional error details... will mark the answer
Are you working with a Trial license? Although the Trial license is a P2 license you can't create additional environments if you are using a Trial account.
Michael E. Gernaey
9
Super User 2025 Season 1
bscarlavai33
5
Super User 2025 Season 1
getsplash
2