@ResourceGroupPreparer(location=WINDOWS_ASP_LOCATION_FUNCTIONAPP)
@StorageAccountPreparer()
def test_functionapp_show_deployment_logs(self, resource_group, storage_account):
    functionapp_name = self.create_random_name(prefix='show-deployment-functionapp', length=40)
    plan_name = self.create_random_name(prefix='show-deployment-functionapp', length=40)
    zip_file = os.path.join(TEST_DIR, 'sample_dotnet_function/sample_dotnet_function.zip')
    self.cmd('functionapp plan create -g {} -n {} --sku S1'.format(resource_group, plan_name))
    self.cmd('functionapp create -g {} -n {} --plan {} -s {} --runtime dotnet'.format(resource_group, functionapp_name, plan_name, storage_account))
    self.cmd('functionapp log deployment show -g {} -n {}'.format(resource_group, functionapp_name), checks=[JMESPathCheck('length(@)', 0)])
    requests.get('http://{}.scm.azurewebsites.net'.format(functionapp_name), timeout=240)
    time.sleep(30)
    deployment_1 = self.cmd('functionapp deployment source config-zip -g {} -n {} --src "{}"'.format(resource_group, functionapp_name, zip_file)).assert_with_checks([JMESPathCheck('status', 4), JMESPathCheck('deployer', 'ZipDeploy'), JMESPathCheck('complete', True)]).get_output_in_json()
    self.cmd('functionapp log deployment show -g {} -n {}'.format(resource_group, functionapp_name), checks=[JMESPathCheck('length(@) > `0`', True)])
    self.cmd('functionapp log deployment show -g {} -n {} --deployment-id={}'.format(resource_group, functionapp_name, deployment_1['id']), checks=[JMESPathCheck('length(@) > `0`', True)])
@ResourceGroupPreparer(location=WINDOWS_ASP_LOCATION_FUNCTIONAPP)
@StorageAccountPreparer()
def test_functionapp_show_deployment_logs(self, resource_group, storage_account):
    functionapp_name = self.create_random_name(prefix='show-deployment-functionapp', length=40)
    plan_name = self.create_random_name(prefix='show-deployment-functionapp', length=40)
    zip_file = os.path.join(TEST_DIR, 'sample_dotnet_function/sample_dotnet_function.zip')
    self.cmd('functionapp plan create -g {} -n {} --sku S1'.format(resource_group, plan_name))
    self.cmd('functionapp create -g {} -n {} --plan {} -s {} --runtime dotnet'.format(resource_group, functionapp_name, plan_name, storage_account))
    self.cmd('functionapp log deployment show -g {} -n {}'.format(resource_group, functionapp_name), checks=[JMESPathCheck('length(@)', 0)])
    requests.get('http://{}.scm.azurewebsites.net'.format(functionapp_name), timeout=240)
    time.sleep(30)
    deployment_1 = self.cmd('functionapp deployment source config-zip -g {} -n {} --src "{}"'.format(resource_group, functionapp_name, zip_file)).assert_with_checks([JMESPathCheck('status', 4), JMESPathCheck('deployer', 'ZipDeploy'), JMESPathCheck('complete', True)]).get_output_in_json()
    self.cmd('functionapp log deployment show -g {} -n {}'.format(resource_group, functionapp_name), checks=[JMESPathCheck('length(@) > `0`', True)])
    self.cmd('functionapp log deployment show -g {} -n {} --deployment-id={}'.format(resource_group, functionapp_name, deployment_1['id']), checks=[JMESPathCheck('length(@) > `0`', True)])