web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

New-CrmInstance Powershell /add Database/ Dyn365Apps

(0) ShareShare
ReportReport
Posted on by 5

Hi all,

i want to create a new online instance via PS. 

im able to provide this with with

$NewCrmInstance = New-CrmInstanceInfo -BaseLanguage 1033 -DomainName matptest -FriendlyName "Contoso production instance" -InitialUserEmail admin@contoso.onmicrosoft.com -InstanceType Sandbox -ServiceVersionId 31cafafe-c6b1-4c0a-bb53-73927841bc5c -CurrencyCode 840 -CurrencyName USD -CurrencyPrecision 2 -CurrencySymbol $ -Purpose "This is a new production environment for Contoso."

BUT i cant find the parameters for adding a database and enabling dynamics 365 apps. 

Any knowledge around ?

best in advanced!

I have the same question (0)
  • Suggested answer
    PerezAguiar Profile Picture
    Microsoft Employee on at
    RE: New-CrmInstance Powershell /add Database/ Dyn365Apps

    Hey Meekmann!

    new-CrmInstanceInfo provisioned an environment already with a database.  However, most of these commands are either deprecated or will be deprecated soon.  Instead, you should use "new-adminpowerappenvironment" as indicated on  https://learn.microsoft.com/en-us/powershell/module/microsoft.powerapps.administration.powershell/new-adminpowerappenvironment?view=pa-ps-latest.  This will allow you to specify the location (EMEA, ASIA, US, etc) and the specific datacenter (West-Europe, North Europe, or UK South/UK Central).  Also, you can set the creation of a database with -provisionDatabase switch, and for the Dynamics365 Apps, you can use the -Template option


    Regards,

  • meekmann Profile Picture
    5 on at
    RE: New-CrmInstance Powershell /add Database/ Dyn365Apps

    Thanks a Lot Daniel!

    Now im desperately seaching for the replacement of the old "connectionhost" parameter aka the root service endpoint

    f.e. $connectionhost = "admin.services.crm4.dynamics.com"

    when i drop

    New-AdminPowerAppEnvironment -DisplayName 'xxx' -Location Europe -EnvironmentSku Sandbox -CurrencyName EUR -LanguageName German -Templates $Null -DomainName xxx -WaitUntilFinished $true -ApiVersion

    the Organisation is not created in our Powerplatform Enviroment where our Dyn365 Stuff is running...

  • Suggested answer
    PerezAguiar Profile Picture
    Microsoft Employee on at
    RE: New-CrmInstance Powershell /add Database/ Dyn365Apps

    Hey.

    if you run the "-templates $Null" you won't be able to provision Dynamics 365 Apps. You get an environment with a database, but no possibility to deploy D365 Apps.   Second:  the command will run in the context of the user running the powershell.  So a piece of advise: before running the New-adminpowerappEnvironment, try running another command (like Get-AdminPowerAppEnvironment to see the list of environments). This will ask for authentication and you'll be able to see if you're connected  to the right location.

    Finally, for the templates part:  run "get-adminpowerappcdsdatabasetemplates". This will ask for the location (for example europe or unitedstates).  learn.microsoft.com/.../get-adminpowerappcdsdatabasetemplates

    Regards

  • meekmann Profile Picture
    5 on at
    RE: New-CrmInstance Powershell /add Database/ Dyn365Apps

    Thanks again Daniel,

    the Issue regarding "where the Enviroment" is created is more related to the internal path.

    1) now

    2) targetpath like it should be.

    1)Internal : @{id=/providers/Microsoft.BusinessAppPlatform/environments/<guid>; type=Microsoft.BusinessAppPlatform/environments; location=europe; name=<guid>;

    properties=}

    2)Internal : @{id=/providers/Microsoft.BusinessAppPlatform/scopes/admin/environments/<guid>; type=Microsoft.BusinessAppPlatform/scopes/environments; location=europe;

    name=<guid>; properties=}

    when i run New-adminpowerappEnvironment i see all Enviroments like in 2) , all good, but as soon as i run

    New-AdminPowerAppEnvironment -DisplayName 'xxx' -Location Europe -EnvironmentSku Sandbox -CurrencyName EUR -LanguageName German -Templates D365_Sales -DomainName xxx -WaitUntilFinished $true

    the Output is at /providers/Microsoft.BusinessAppPlatform/environments/

  • meekmann Profile Picture
    5 on at
    RE: New-CrmInstance Powershell /add Database/ Dyn365Apps

    got it! i have to address -ProvisionDatabase than the Path is correct

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 123 Super User 2025 Season 2

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 89

#3
#ManoVerse Profile Picture

#ManoVerse 85

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans