Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
VixiXia opened this issue Feb 14, 2024 · 8 comments
Assignees
Labels
Auto-Assign Auto assign by bot azf_bug azf_reviewed azf_triaged bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Functions az functionapp needs-author-feedback More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. Service Attention This issue is responsible by Azure service team.

Comments

@VixiXia
Copy link

VixiXia commented Feb 14, 2024

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 VixiXia added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Feb 14, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Feb 14, 2024

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

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot labels Feb 14, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added Functions az functionapp Service Attention This issue is responsible by Azure service team. labels Feb 14, 2024
@VixiXia
Copy link
Author

VixiXia commented Feb 19, 2024

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

@VixiXia
Copy link
Author

VixiXia commented Feb 22, 2024

@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
Copy link
Author

VixiXia commented Feb 26, 2024

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

@VixiXia
Copy link
Author

VixiXia commented Mar 1, 2024

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)

@kamperiadis
Copy link
Contributor

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 kamperiadis added needs-author-feedback More information is needed from author to address the issue. azf_triaged labels Apr 29, 2024
Copy link
Contributor

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

Copy link
Contributor

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!

@microsoft-github-policy-service microsoft-github-policy-service bot added the no-recent-activity There has been no recent activity on this issue. label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot azf_bug azf_reviewed azf_triaged bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Functions az functionapp needs-author-feedback More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

6 participants