@ResourceGroupPreparer(location=WINDOWS_ASP_LOCATION_WEBAPP)
def test_webapp_vnetDelegation(self, resource_group):
    webapp_name = self.create_random_name('swiftwebapp', 24)
    plan = self.create_random_name('swiftplan', 24)
    subnet_name = self.create_random_name('swiftsubnet', 24)
    vnet_name = self.create_random_name('swiftname', 24)
    self.cmd('network vnet create -g {} -n {} --address-prefix 10.0.0.0/16 --subnet-name {} --subnet-prefix 10.0.0.0/24'.format(resource_group, vnet_name, subnet_name))
    self.cmd('network vnet subnet update -g {} --vnet {} --name {} --delegations Microsoft.Web/serverfarms --service-endpoints Microsoft.Storage'.format(resource_group, vnet_name, subnet_name))
    self.cmd('appservice plan create -g {} -n {} --sku P1V2'.format(resource_group, plan))
    self.cmd('webapp create -g {} -n {} --plan {}'.format(resource_group, webapp_name, plan))
    self.cmd('webapp vnet-integration add -g {} -n {} --vnet {} --subnet {}'.format(resource_group, webapp_name, vnet_name, subnet_name))
    self.cmd('webapp vnet-integration list -g {} -n {}'.format(resource_group, webapp_name), checks=[JMESPathCheck('length(@)', 1), JMESPathCheck('[0].name', subnet_name)])
    self.cmd(' network vnet subnet show -g {} -n {} --vnet-name {}'.format(resource_group, subnet_name, vnet_name), checks=[JMESPathCheck('serviceEndpoints[0].service', 'Microsoft.Storage')])
    self.cmd('webapp vnet-integration remove -g {} -n {}'.format(resource_group, webapp_name))
    self.cmd('webapp vnet-integration list -g {} -n {}'.format(resource_group, webapp_name), checks=[JMESPathCheck('length(@)', 0)])
@ResourceGroupPreparer(location=WINDOWS_ASP_LOCATION_WEBAPP)
def test_webapp_vnetDelegation(self, resource_group):
    webapp_name = self.create_random_name('swiftwebapp', 24)
    plan = self.create_random_name('swiftplan', 24)
    subnet_name = self.create_random_name('swiftsubnet', 24)
    vnet_name = self.create_random_name('swiftname', 24)
    self.cmd('network vnet create -g {} -n {} --address-prefix 10.0.0.0/16 --subnet-name {} --subnet-prefix 10.0.0.0/24'.format(resource_group, vnet_name, subnet_name))
    self.cmd('network vnet subnet update -g {} --vnet {} --name {} --delegations Microsoft.Web/serverfarms --service-endpoints Microsoft.Storage'.format(resource_group, vnet_name, subnet_name))
    self.cmd('appservice plan create -g {} -n {} --sku P1V2'.format(resource_group, plan))
    self.cmd('webapp create -g {} -n {} --plan {}'.format(resource_group, webapp_name, plan))
    self.cmd('webapp vnet-integration add -g {} -n {} --vnet {} --subnet {}'.format(resource_group, webapp_name, vnet_name, subnet_name))
    self.cmd('webapp vnet-integration list -g {} -n {}'.format(resource_group, webapp_name), checks=[JMESPathCheck('length(@)', 1), JMESPathCheck('[0].name', subnet_name)])
    self.cmd(' network vnet subnet show -g {} -n {} --vnet-name {}'.format(resource_group, subnet_name, vnet_name), checks=[JMESPathCheck('serviceEndpoints[0].service', 'Microsoft.Storage')])
    self.cmd('webapp vnet-integration remove -g {} -n {}'.format(resource_group, webapp_name))
    self.cmd('webapp vnet-integration list -g {} -n {}'.format(resource_group, webapp_name), checks=[JMESPathCheck('length(@)', 0)])