Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

New-CrmInstance Powershell /add Database/ Dyn365Apps

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!

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

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

  • meekmann Profile Picture
    meekmann 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/

  • Suggested answer
    PerezAguiar Profile Picture
    PerezAguiar 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
    meekmann 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
    PerezAguiar 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,

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans