azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

az functionapp deployment source config-zip --build-remote false is been treated as "--build-remote true"

Open VixiXia opened this issue 1 year ago • 8 comments

Describe the bug

When running az functionapp deployment source config-zip --build-remote false to do deployment to Linux function app, it is been treated as setting "--build-remote true" which enabled remote build and also set SCM_DO_BUILD_DURING_DEPLOYMENT to true for the function app based on code logic add_remote_build_app_settings during the deployment.

If we do not specify the parameter --build-remote, it will use the default value false which is working fine, but if we specify --build-remote false, it treats it as --build-remote true. Based on code logic here azure-cli/src/azure-cli/azure/cli/command_modules/appservice/custom.py at release · Azure/azure-cli (github.com), it will check build-remote value, if build-remote is false, it should go to remove_remote_build_app_settings instead of add_remote_build_app_settings, however it goes to add_remote_build_app_settings logic here, not sure if the parameter value passed is changed or any code logic issue here:

image image

Related command

az functionapp deployment source config-zip --build-remote false

Errors

No error, it is just the behavior is not correct as expected.

Issue script & Debug output

cli.azure.cli.command_modules.appservice.custom: Setting SCM_DO_BUILD_DURING_DEPLOYMENT to true

Expected behavior

It should not enable remote build and also do not set SCM_DO_BUILD_DURING_DEPLOYMENT to true.

Environment Summary

azure-cli 2.57.0 core 2.57.0 telemetry 1.1.0 Dependencies: msal 1.26.0 azure-mgmt-resource 23.1.0b2

Additional context

No response

VixiXia avatar Feb 14 '24 07:02 VixiXia

Thank you for opening this issue, we will look into it.

yonzhan avatar Feb 14 '24 07:02 yonzhan

@yonzhan Good day. May I know if we have any update on this issue?

VixiXia avatar Feb 19 '24 01:02 VixiXia

@shreyas-gopalakrishna Good day. Would you please help check this issue? If we do not specify the parameter --build-remote, it will use the default value false which is working fine, but if we specify --build-remote false, it treats it as --build-remote true. Based on code logic here azure-cli/src/azure-cli/azure/cli/command_modules/appservice/custom.py at release · Azure/azure-cli (github.com), it will check build-remote value, seems logic is correct. Not sure which part caused the issue here.

VixiXia avatar Feb 22 '24 06:02 VixiXia

@shreyas-gopalakrishna @amamounelsayed @kaibocai @kamperiadis Wish everything is fine there. Would you please help check this issue?

VixiXia avatar Feb 26 '24 09:02 VixiXia

I checked the source code, it seems like it is due to code logic below, if return_label set to true, it always return the label which is a string not a boolean value image image image

so the condition below always be true no matter we pass --build-remote true or --build-remote false seems like we just need to change the code to not pass return_label and the default value is False for this to return boolean value for the parameter

with self.argument_context(scope + ' deployment source config-zip') as c: c.argument('src', help='a zip file path for deployment') c.argument('build_remote', help='enable remote build during deployment', arg_type=get_three_state_flag())

azure-cli/src/azure-cli/azure/cli/command_modules/appservice/_params.py at release · Azure/azure-cli (github.com) azure-cli/src/azure-cli-core/azure/cli/core/commands/parameters.py at release · Azure/azure-cli (github.com) azure-cli/src/azure-cli/azure/cli/command_modules/appservice/custom.py at release · Azure/azure-cli (github.com)

VixiXia avatar Mar 01 '24 01:03 VixiXia

Hi @VixiXia! This should be fixed with the latest Azure CLI version. Can you please try to see if you are still experiencing this issue? Thank you!

kamperiadis avatar Apr 29 '24 15:04 kamperiadis

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AnatoliB, @Francisco-Gamino, @shreyabatra4.

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!