Thursday, July 17, 2025

Provisioning a unified environment (UDE) for D365 Finance & Operations Sandbox Using PowerShell

🚀 Provisioning a D365 Finance & Operations Sandbox Using PowerShell

Setting up a Dynamics 365 Finance and Operations (D365 F&O) sandbox environment can be a game-changer for developers and consultants working on enterprise-grade solutions. This guide walks you through the process of provisioning a developer-focused environment using PowerShell and the Power Platform Admin Center.

✅ Prerequisites

  • Admin Access: Appropriate permissions in the Power Platform Admin Center.
  • Licensing: One of the following licenses:
    • Dynamics 365 Finance
    • Dynamics 365 Supply Chain Management
    • Dynamics 365 Project Operations
  • Power Platform CLI: Installed and updated to the latest version.
  • Execution Policy: Ensure PowerShell scripts are allowed to run:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force

🛠 Step 1: Create the Environment

We’ll use PowerShell to provision a D365 F&O sandbox environment.

1. Install the Power Platform Admin Module

Install-Module -Name Microsoft.PowerApps.Administration.PowerShell

2. Authenticate to Power Platform

Add-PowerAppsAccount -Endpoint prod

3. Define the Provisioning Template

$jsonObject= @" 
{ 
  "PostProvisioningPackages": 
  [ 
    { 
      "applicationUniqueName": "msdyn_FinanceAndOperationsProvisioningAppAnchor", 
      "parameters": "DevToolsEnabled=true|DemoDataEnabled=true" 
    } 
  ] 
} 
"@ | ConvertFrom-Json



4. Provision the Environment

New-AdminPowerAppEnvironment -DisplayName "<<Environment Name>>" `
  -EnvironmentSku Sandbox `
  -Templates "D365_FinOps_Finance" `
  -TemplateMetadata $jsonObject `
  -LocationName "unitedstates" `
  -ProvisionDatabase




Note: Replace <<Environment Name>> with a friendly name. Use the appropriate template ID based on your license:

LicenseTemplate NameTemplate ID
Dynamics 365 FinanceFinance (preview)D365_FinOps_Finance
Supply Chain ManagementSCM (preview)D365_FinOps_SCM
Project OperationsProject Ops Integrated (preview)D365_FinOps_ProjOps
Commerce (Trial Only)Commerce (preview)D365_FinOps_Commerce

⏳ Step 2: Monitor Deployment



Ready (usually takes ~2 hours).

🔍 Step 3: Validate the Environment

  1. Open the Finance and Operations URL.
  2. Search for “Users” and open the Users form under System Administration.
  3. Update the Company for the Admin user to USMF.


🔄 Step 4: Update PowerAIExtensions Solution

  1. Go to your environment in the Power Platform Admin Center.
  2. Navigate to Resources > Dynamics 365 Apps.
  3. If an update is available for Microsoft Dynamics 365 – PowerAIExtensions, click Update.


Troubleshooting

If you encounter an error that indicates scripts is disabled then execute the following command in Powershell to provide the required permissions:

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force
Import-Module Microsoft.PowerApps.Administration.PowerShell -Force



No comments:

Post a Comment