Jānis Veinbergs ca va, ca va, thanks for bringing this up ))
let's tackle the microsoft side. since u already did the geo migration and ms support confirmed the old env is gone, the error might just be stale metadata. try this powerShell command to force unlink the policy from the ghost env
Remove-AzResource -ResourceId "/subscriptions/[your-sub-id]/resourceGroups/[your-rg]/providers/Microsoft.PowerPlatform/enterprisePolicies/[policy-name]" -Force
if that doesn't work, u might need to nudge the azure resource manager. sometimes it gets stuck like a croissant in a parisian café )) check this doc for deeper cleanup steps learn.microsoft.com/power-platform/admin/manage-environments#delete-an-environment.
also, peek into the azure resource graph explorer. run this query to see if the old env id still lurks somewhere
resources
| where type == "microsoft.powerplatform/environments"
| where properties.environmentId == "628b9eda-13f4-ef50-a287-7b586ef7995c"
if it shows up, ms support might need to purge it from their backend.
now for some general tips that could save u headaches later )) always double check subnet injections before deleting policies. its like untangling earphones skip a step, and everything knots up. this might help in other tools too, especially when dealing with cross region setups.
worth looking into azure policies as well. sometimes they hold references to deleted resources like overattached exes )) learn.microsoft.com/azure/governance/policy/overview.
if u ever do another geo migration, maybe take screenshots of the old env configs. old school, but it beats chasing ghost ids later :))
let me know if the force delete worked
Best regards,
Alex
and "yes" if you would follow me at Q&A - personaly thx.
P.S. If my answer help to you, please Accept my answer