-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Webapp:az webapp vnet-integration add fails when the App Service Plan is not in its original resource group #14597
Description
This is a reincarnation of #12629 which I believe was incorrectly closed as a duplicate when it is not. Commenting on the closed issue is not getting any attention so I am re-creating it.
Describe the bug
Move an app service and its app service plan to a new resource group and you can no longer use the az webapp vnet-integration commands. This seems to be a common and frustrating recurring theme with app services in general - they don't work well if you move them out of their original resource group which their webspace is tied to. I only have the one app service plan and it is already connected to the vnet through other app services, there are no other app services plans connected to the vnet. Using the Azure Portal also does not work.
Command
az webapp vnet-integration add --resource-group GroupNEW --name AppService1 --vnet Vnet1 --subnet Subnet1
Error
Operation returned an invalid status code 'Conflict'
Debug details
Subnet Subnet1 in VNET Vnet1 is already occupied by service /subscriptions/123/resourceGroups/GroupOLD/providers/Microsoft.Web/serverfarms/AppServicePlan1.
To Reproduce
- Move an app service and its app service plan to a new resource group.
- Try to use the
az webapp vnet-integration addcommand on it. - Error: Operation returned an invalid status code 'Conflict'
Expected behavior
Success
Workaround
- Move the App Service Plan back to a resource group named the same as the original it was created in.
- Connect the vnet.
- You can then move it back to the new group if required.