Automating the Creation of Dynamics 365 F&O Unified Developer Experience (UDE) Environments
The Unified Developer Experience (UDE) introduces an advanced approach to environment provisioning, replacing traditional Cloud-hosted environments and streamlining development in both Dynamics 365 Finance and Operations (D365 FO) and Power Platform simultaneously.
What is Unified Developer Experience (UDE)?
The UDE environment is an online environment that combines two essential instances:
Dynamics 365 Finance and Operations (D365 FO)
Dataverse
By integrating these two instances, UDE enhances connectivity and data synchronization, allowing developers to work efficiently across both platforms without switching between different setups.
Key Features of UDE
Replacement for Cloud-hosted Environments
UDE provides an optimized development setup, eliminating the need for traditional Cloud-hosted environments.
It offers a scalable and easily configurable sandbox for development and testing.
Unified Development Across D365 FO and Power Platform
Developers can work on Finance and Operations applications and Power Platform solutions simultaneously, fostering a more agile development experience.
Custom applications built in Power Apps can seamlessly interact with Finance and Operations functionalities.
Enhanced Integration Using Dual Write and Virtual Entities
Virtual Entities allow seamless data access from D365 FO into Dataverse, improving interoperability between the two environments.
Dual Write enables real-time synchronization between Dataverse and D365 FO, ensuring consistency across applications.
As a Dynamics 365 Finance and Operations (D365 FO) developer, you can seamlessly set up and connect to your online Unified Developer Experience (UDE) environment directly from your local Visual Studio instance. This setup allows you to efficiently develop, test, and deploy customizations to D365 FO, leveraging the full capabilities of Power Platform and Dataverse within the same environment.
So, what about sandbox/test environments?
“USE” Unified Sandbox Environments: The Future of Sandbox Environments for D365 FO
Microsoft is introducing a new version of environments—USE environments—which provides sandbox instances with 3 AOS to replace traditional sandbox environments (UAT, pre-production) that were previously created in Lifecycle Services (LCS). Compared to UDE, which includes only 1 AOS and is specifically dedicated to developers, USE environments offer a broader scope for testing and validation. Additionally, production environments will soon be available in the Power Platform admin center (PPAC), further streamlining management and configuration within the Power Platform ecosystem.
Since LCS will be deprecated, organizations must start preparing for the migration from LCS to Power Platform, ensuring a smooth transition to the new management framework. UDE is now publicly available, and at Dynagile, we assign one UDE environment per consultant and actively use it with our clients as a developer environment.
After these definitions let’s jump to the main Subject 😉
Getting Started with UDE
For detailed guidance on setting up a UDE environment, you can consult Aurelien’s Blog: https://www.powerazure365.com/blog-1/dynamics-365-finops-unified-developer-experience
As mentioned in Aurelien’s blog we can create UDE environment using scripts/User interface PPAC.
This article details the automation of UDE environment creation/deletion using Power Platform, DevOps pipelines, and Power Automate flows.
Solution Overview
Instead of manually creating an environment for each employee using scripts/User interface PPAC, I developed a Power App that facilitates environment provisioning and deletion based on selected employees. The employee data is synchronized with Entra ID, though we won’t delve into that aspect here.
Behind this Power App, three Power Automate flows, three DevOps pipelines and a Dataverse table that contains the list of environments in the tenant
Environment Naming Convention
The domain follows this structure: dynagle-d365- Employee Trigram]-[Environment Number]
Step 1: Creating the Environment (DYN_CreateEnvironment Flow)
Workflow Summary
This flow automates environment creation by:
Retrieving the user ID from Entra ID and calculating the user's trigram.
Checking if the user's security group exists in Entra ID; if not, creating it via Graph API.
Executing the DevOps pipeline Create_finops_ude to provision the environment.
DevOps Pipeline: Create_finops_ude (YAML Code)
The pipeline uses YAML scripting, the script use Microsoft.PowerApps.Administration.PowerShell command to create the online environment.
parameters: - name: environmentName type: string default: 'Dynagile-DevBox-FnO-xxx' - name: securityGroupId type: string default: 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' - name: domainName type: string default: 'dynagile-d365-xxx' trigger: none pool: vmImage: windows-latest steps: - checkout: self fetchDepth: 1 persistCredentials: True displayName: 'Checkout' # Install Power Platform module - task: PowerShell@2 inputs: targetType: 'inline' script: | Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -Force #JS_Connect to Power Platform - task: PowerShell@2 inputs: targetType: 'inline' script: | Write-Host "Creating a session against the Power Platform API" $PasswordCleartext ="**********" $Password ="$PasswordCleartext" | ConvertTo-SecureString -AsPlainText -Force Add-PowerAppsAccount -Endpoint prod -Username "******" -Password $Password -Verbose #To construct the json object to pass in $jsonObject= @" { "PostProvisioningPackages": [ { "applicationUniqueName": "msdyn_FinanceAndOperationsProvisioningAppAnchor", "parameters": "DevToolsEnabled=true|DemoDataEnabled=true" } ] } "@ | ConvertFrom-Json #JS_CreateEnvironement New-AdminPowerAppEnvironment -DisplayName ${{parameters.environmentName}} -EnvironmentSku Sandbox -Templates "D365_FinOps_Finance" -TemplateMetadata $jsonObject -LocationName "Europe" -ProvisionDatabase -CurrencyName "EUR" -SecurityGroupId ${{parameters.securityGroupId}} -DomainName ${{parameters.domainName}} -WaitUntilFinished $false -Verbose
Post-Pipeline Actions
After executing the pipeline:
Wait five minutes and verify if the environment exists in power platform using an HTTP GET request.
If found, register the environment in Dataverse table with status "Creation in progress".
Send an email to both the user and the creator, notifying them of the new environment.
Step 2: Configuring Managed Environments (DYN_ImportUsertoD365FO Flow)
Workflow Summary
Once an environment is created, another flow DYN_ImportUsertoD365FO makes it Managed by running a DevOps pipeline. This flow also manages the governance and security of online environments (UDE), ensuring that user access to D365 FO and Dataverse is properly controlled. At Dynagile, we handle environment governance through Power Apps and Power Automate, leveraging automated flows to grant access to users efficiently within both platforms.
DevOps Pipeline: finops-Manage_ude (YAML Code)
parameters: - name: environmentURL type: string default: 'https://dynagile-d365-xxx.crm4.dynamics.com/' - name: serviceConnectionName type: string default: 'Dyn_ServiceConnection_PP' trigger: none pool: vmImage: windows-latest steps: - checkout: self fetchDepth: 1 persistCredentials: True displayName: 'Checkout' # Installs PowerPlatform Tools (including PAC CLI) - task: PowerPlatformToolInstaller@2 displayName: 'Install Power Platform Build Tools' # Sets the Connection variables from the Service Connection passed in input parameter # Will set BuildTools.ApplicationId, BuildTools.ClientSecret, BuildTools.TenantId - task: PowerPlatformSetConnectionVariables@2 displayName: 'Set Connection Variables - ${{parameters.serviceConnectionName}}' name: ConnectionVariables inputs: authenticationType: PowerPlatformSPN PowerPlatformSPN: '${{parameters.serviceConnectionName}}' # Enable Managed environment - task: PowerPlatformSetGovernanceConfig@2 inputs: authenticationType: 'PowerPlatformSPN' PowerPlatformSPN: 'Dyn_ServiceConnection_PP' Environment: '${{parameters.environmentURL}}' ProtectionLevel: 'Standard'
Post-Pipeline Actions
Assign the Admin Role to the user in D365FO.
Grant admin access to the user within Power Platform.
Update the environment status in Dataverse to "Created".
Send a notification email informing the user of their access.
· Scheduled Execution: This flow runs every 4 hours to ensure continuous management of environments.
Step 3: Deleting Environments (DYN_DeleteEnvironment Flow)
Workflow Summary
Users can delete their environments directly in Power Apps via a Delete button. with the deletion process managed by executing a DevOps pipeline that uses PAC CLI to efficiently remove the environment while maintaining governance and compliance.
DevOps Pipeline: Delete_finops_ude (YAML Code)
parameters: - name: environmentURL type: string default: 'https://dynagile-d365-xxx.crm4.dynamics.com/' - name: serviceConnectionName type: string default: 'Dyn_ServiceConnection_PP' trigger: none pool: vmImage: windows-latest steps: - checkout: self fetchDepth: 1 persistCredentials: True displayName: 'Checkout' # Installs PowerPlatform Tools (including PAC CLI) - task: PowerPlatformToolInstaller@2 displayName: 'Install Power Platform Build Tools' # Sets the Connection variables from the Service Connection passed in input parameter # Will set BuildTools.ApplicationId, BuildTools.ClientSecret, BuildTools.TenantId - task: PowerPlatformSetConnectionVariables@2 displayName: 'Set Connection Variables - ${{parameters.serviceConnectionName}}' name: ConnectionVariables inputs: authenticationType: PowerPlatformSPN PowerPlatformSPN: '${{parameters.serviceConnectionName}}' - task: PowerPlatformDeleteEnvironment@2 inputs: authenticationType: 'PowerPlatformSPN' PowerPlatformSPN: 'Dyn_ServiceConnection_PP' Environment: '${{parameters.environmentURL}}'
Post-Deletion Actions
Update the status in Dataverse table record to "Deletion in progress".
Verify deletion completion: The DYN_ImportUsertoD365FO Flow checks if the environment no longer appears in Power Platform’s environment list.
Final status update: If deletion is confirmed, Dataverse updates the operation status to "Deleted".
Notify the user that their environment has been successfully deleted.
Conclusion
Automating the UDE environment lifecycle significantly enhances efficiency while minimizing manual intervention. Power Platform, Power Automate, and Azure DevOps pipelines work together seamlessly to create, configure, and delete environments based on developer needs.