Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
I understand that you are unable to add a subnet to a VNET.
From your error message, it appears,
- There is a VPN Gateway "xyz" deployed into the VNET
- And this VPN Gateway is in a failed state
As next steps,
- You have to first bring the VPN Gateway to a succeeded state
- You can do this by doing a GET and SET Operation on the VPN Gateway, with some minor changes (which you can revert back)
$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "<ResourceGroupName>" -Name "<VPNGatewayName>"
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -Tag @{ testtagKey="SomeTagKey"; testtagValue="SomeKeyValue" }
The above example adds a tag which you can later remove, once the VPN Gateway goes into a Succeeded state.
Post which, you should be able to add a subnet to the VNET
Kindly let us know how this goes and if you need further assistance on this issue.
Thanks,
Kapil