add parameter to deploy new unified environment in early release cycle #128 - #131
Conversation
There was a problem hiding this comment.
Pull request overview
Adds early-release-cycle provisioning support to New-UnifiedEnvironment.
Changes:
- Adds the
-EarlyReleaseswitch and help example. - Adds
cluster.category = "FirstRelease"to creation payloads.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| [switch] $WaitForCompletion | ||
| [switch] $WaitForCompletion, | ||
|
|
||
| [switch] $EarlyRelease |
| if ($EarlyRelease.IsPresent) { | ||
| $config.properties | ` | ||
| Add-Member -MemberType NoteProperty ` | ||
| -Name cluster ` | ||
| -Value ([PsCustomObject][ordered]@{ | ||
| category = "FirstRelease" |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@Splaxi I have another version that uses the api.powerplatform.com API here: FH-Inway@f068105 Since that API is documented, I would rather use it. However, it introduces an unrelated change for the parameter region, which is now called Macro Region instead of Azure Region. It also cannot be used together with location and it seems to be a tenant setting if it can be used at all (see https://learn.microsoft.com/en-us/rest/api/power-platform/environmentmanagement/environment-provisioning/get-supported-locations). Let me know if that is a blocker for you, otherwise I would prepare the api.powerplatform.com version for merge. I also noticed there is no workflow yet to update the documentation and signature tests like there is for d365fo.tools. Anything I should know before trying to add it? |
| -Value $SecurityGroupId | ||
| } | ||
|
|
||
| if ($EarlyRelease.IsPresent) { |
There was a problem hiding this comment.
I think I remember at IsPresent will actually trigger - if you do EarlyRelease:$false
Normal if - just on the var is what we are after.
Make a local test function - and prove me wrong 😉
There was a problem hiding this comment.
Copilot gave me this, which convinces me:
function Test-EarlyReleaseSwitch {
param(
[switch] $EarlyRelease
)
$result = [ordered]@{
IsPresent = $EarlyRelease.IsPresent
ToString = $EarlyRelease.ToString()
}
[pscustomobject]$result
}
Write-Host "No switch passed:"
Test-EarlyReleaseSwitch
Write-Host "Switch passed explicitly false:"
Test-EarlyReleaseSwitch -EarlyRelease:$false
Write-Host "Switch passed explicitly true:"
Test-EarlyReleaseSwitch -EarlyRelease:$trueOutput:
No switch passed:
Switch passed explicitly false:
Switch passed explicitly true:
IsPresent ToString
--------- --------
False False
False False
True True
There was a problem hiding this comment.
But yeah, let me remove it, doesn't make sense in this context.
| PostProvisionDelaySeconds = $PostProvisionDelaySeconds | ||
| ReadyStateTimeoutMinutes = $ReadyStateTimeoutMinutes | ||
| ReadyStateTimeoutMinutes = $ReadyStateTimeoutMinutes | ||
| EarlyRelease = $EarlyRelease.IsPresent |
There was a problem hiding this comment.
IsPresent was discussed further down - this might not be what you are after
|
I'm not sure. We are focused on getting things to west europe - so that why we have the current support for that. If the new API - it the "right" one to use, and we lose that option - then maybe that is what we should support. What does your gut feeling say ? |
|
My gut feeling says I should not trust my gut on this 😄 However, my test environments that I deployed using api.powerplatform.com give me a weird redirect error when trying to access the D365FO url. So either something is missing or the API is not yet fit for duty.
|
|
Let's stick with what we have for now 😉 |
Block : [-] Validating PS1 Script files
Name : It [internal\functions\Update-PsfConfigVariables.ps1] Should have UTF8 encoding with Byte Order Mark
Result : Failed
Message : Expected strings to be the same, but they were different.
Expected length: 8
Actual length: 7
Strings differ at index 1.
Expected: 'UTF8 BOM'
But was: 'Unknown'
-^
On Windows PowerShell, the common parameter ProgressAction is not available, which causes a lot of errors during validation. Block : [-] Ensuring unchanged command signature Name : It Should have the expected parameter ProgressAction Result : Failed Message : Expected 'ProgressAction', but got $null.
|
Ok, here we go. The cleanup was a bit of a pain, since no scripts to format the comment based help or update the unit tests and docs existed. I copied them over from d365fo.tools. Since they are pretty stable, I think we can live with the redundancy. |
This pull request adds support for creating early release environments in the
New-UnifiedEnvironmentPowerShell function. The main changes introduce a new-EarlyReleaseswitch parameter, update documentation and examples, and ensure the early release option is properly handled in the environment creation payload.implements #128