Skip to content

Webapp:az webapp vnet-integration add fails when the App Service Plan is not in its original resource group #14597

@krispenner

Description

@krispenner

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

  1. Move an app service and its app service plan to a new resource group.
  2. Try to use the az webapp vnet-integration add command on it.
  3. Error: Operation returned an invalid status code 'Conflict'

Expected behavior
Success

Workaround

  1. Move the App Service Plan back to a resource group named the same as the original it was created in.
  2. Connect the vnet.
  3. You can then move it back to the new group if required.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions