Hi ,
Thanks for reaching out to Microsoft Q&A.
The issue of not being able to delete virtual networks or the enterprise policy is likely due to dependencies and locks associated with the Microsoft.PowerPlatform/enterprisePolicies delegation. To resolve this, ensure the Power Platform environment is fully unlinked from the enterprise policy and virtual network. Verify there are no residual dependencies, such as private endpoints or network interfaces, linked to the subnet, and confirm that the delegation has been removed. Additionally, check for any resource locks applied to the virtual network or policy and remove them if present. If the Microsoft.PowerPlatform resource provider cannot be unregistered, ensure it is not being actively used by other environments. If these steps do not resolve the issue, the problem may require assistance from Azure Support to forcefully remove the delegation or any underlying configurations preventing deletion.
Check if there are any residual dependencies in the virtual network or subnets, such as:
- Private Endpoints linked to the vNet.
- Network Interfaces that might still be associated.
- Any other services or configurations that could be using the subnet.
Use the following Azure CLI command to identify resources associated with the subnet
az network vnet subnet show --resource-group <resource-group-name> --vnet-name <vnet-name> --name <subnet-name>
The error indicates that the subnet is delegated to Microsoft.PowerPlatform/enterprisePolicies
. Attempt to remove this delegation explicitly:
az network vnet subnet update --resource-group <resource-group-name> --vnet-name <vnet-name> --name <subnet-name> --remove delegations
If this fails, it might mean the delegation is still actively tied to the Power Platform environment. Check the Power Platform admin portal to ensure:
- The environment is unlinked from the vNet.
- Any policies associated with the environment are removed.
Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.