Fix missing deleteReason parameter in Env Request Cleanup flow#10667
Closed
Fix missing deleteReason parameter in Env Request Cleanup flow#10667
Conversation
The Power Platform Admin API version 2022-05-01 requires a deleteReason parameter when deleting environments. This fix adds the "Expiration" reason to the Delete_expired_Environment action, which resolves the error: "The delete reason was null or invalid." Co-authored-by: AmarSaiRam <220305901+AmarSaiRam@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix cleanup flow to handle expired environment deletion
Fix missing deleteReason parameter in Env Request Cleanup flow
Jan 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Env Request | Cleanup" flow fails when deleting expired environments with error: "The delete reason was null or invalid."
Power Platform Admin API version 2022-05-01 requires a
deleteReasonparameter when callingRemove-AdminEnvironment, but the flow was not providing it.Changes
deleteReason: "Expiration"parameter to theDelete_expired_Environmentaction inEnvRequestCleanup-E1C9B288-F98C-EB11-A812-000D3A1F6A72.jsonOther workflows using older API versions (2018-10-01, 2021-04-01) are unaffected as the parameter is not required in those versions.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.