@ResourceGroupPreparer(parameter_name='resource_group', location=WINDOWS_ASP_LOCATION_WEBAPP)
def test_backup_with_name(self, resource_group):
    plan = self.create_random_name(prefix='plan-backup', length=24)
    self.cmd('appservice plan create -g {} -n {} --sku S1'.format(resource_group, plan))
    webapp = self.create_random_name(prefix='backup-webapp', length=24)
    self.cmd('webapp create -g {} -n {} --plan {}'.format(resource_group, webapp, plan))
    storage_Account = self.create_random_name(prefix='backup', length=24)
    self.cmd('storage account create -n {} -g {} --location {}'.format(storage_Account, resource_group, WINDOWS_ASP_LOCATION_WEBAPP))
    container = self.create_random_name(prefix='backupcontainer', length=24)
    self.cmd('storage container create --account-name {} --name {}'.format(storage_Account, container))
    expirydate = (datetime.datetime.now() + datetime.timedelta(days=1, hours=3)).strftime('"%Y-%m-%dT%H:%MZ"')
    sastoken = self.cmd('storage container generate-sas --account-name {} --name {} --expiry {} --permissions rwdl'.format(storage_Account, container, expirydate))
    sasurl = '"https://{}.blob.core.windows.net/{}?{}"'.format(storage_Account, container, sastoken)
    backup_name = self.create_random_name(prefix='backup-name', length=24)
    self.cmd('webapp config backup create -g {} --webapp-name {} --backup-name {} --container-url {}'.format(resource_group, webapp, backup_name, sasurl), checks=[JMESPathCheck('backupItemName', backup_name)])
@ResourceGroupPreparer(parameter_name='resource_group', location=WINDOWS_ASP_LOCATION_WEBAPP)
def test_backup_with_name(self, resource_group):
    plan = self.create_random_name(prefix='plan-backup', length=24)
    self.cmd('appservice plan create -g {} -n {} --sku S1'.format(resource_group, plan))
    webapp = self.create_random_name(prefix='backup-webapp', length=24)
    self.cmd('webapp create -g {} -n {} --plan {}'.format(resource_group, webapp, plan))
    storage_Account = self.create_random_name(prefix='backup', length=24)
    self.cmd('storage account create -n {} -g {} --location {}'.format(storage_Account, resource_group, WINDOWS_ASP_LOCATION_WEBAPP))
    container = self.create_random_name(prefix='backupcontainer', length=24)
    self.cmd('storage container create --account-name {} --name {}'.format(storage_Account, container))
    expirydate = (datetime.datetime.now() + datetime.timedelta(days=1, hours=3)).strftime('"%Y-%m-%dT%H:%MZ"')
    sastoken = self.cmd('storage container generate-sas --account-name {} --name {} --expiry {} --permissions rwdl'.format(storage_Account, container, expirydate))
    sasurl = '"https://{}.blob.core.windows.net/{}?{}"'.format(storage_Account, container, sastoken)
    backup_name = self.create_random_name(prefix='backup-name', length=24)
    self.cmd('webapp config backup create -g {} --webapp-name {} --backup-name {} --container-url {}'.format(resource_group, webapp, backup_name, sasurl), checks=[JMESPathCheck('backupItemName', backup_name)])