Skip to content

[AppService] az functionapp deployment source config-zip: Show log progress from kudu pod#33266

Draft
kamperiadis wants to merge 1 commit intoAzure:devfrom
kamperiadis:fdmlogging
Draft

[AppService] az functionapp deployment source config-zip: Show log progress from kudu pod#33266
kamperiadis wants to merge 1 commit intoAzure:devfrom
kamperiadis:fdmlogging

Conversation

@kamperiadis
Copy link
Copy Markdown
Contributor

Related command
az functionapp deployment source config-zip

Description

Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


This checklist is used to make sure that common guidelines for a pull request are followed.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented Apr 24, 2026

❌AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
❌appservice
❌latest
❌3.12
Type Test Case Error Message Line
Failed test_enable_zip_deploy_flex self = <azure.cli.command_modules.appservice.tests.latest.test_functionapp_commands_thru_mock.TestFunctionappMocked testMethod=test_enable_zip_deploy_flex>
check_zip_deployment_status_mock = <MagicMock name='check_zip_deployment_status_flex' id='139874551799424'>
requests_post_mock = <function post at 0x7f3714ffd4e0>
get_scm_site_headers_flex_mock = <MagicMock name='get_scm_site_headers_flex' id='139874549176976'>
get_runtime_config_mock = <MagicMock name='get_runtime_config' id='139874549180768'>
get_scm_url_mock = <MagicMock name='get_scm_url' id='139874549184608'>

    @mock.patch('azure.cli.command_modules.appservice.custom.get_scm_url', return_value='https://mock-scm')
    @mock.patch('azure.cli.command_modules.appservice.custom.get_runtime_config')
    @mock.patch('azure.cli.command_modules.appservice.custom.get_scm_site_headers_flex')
    @mock.patch('requests.post', autospec=True)
    @mock.patch('azure.cli.command_modules.appservice.custom.check_zip_deployment_status_flex')
    def test_enable_zip_deploy_flex(self,
                                    check_zip_deployment_status_mock,
                                    requests_post_mock,
                                    get_scm_site_headers_flex_mock,
                                    get_runtime_config_mock,
                                    get_scm_url_mock):
        # prepare
        cmd_mock = get_test_cmd()
        cli_ctx_mock = mock.MagicMock()
        cmd_mock.cli_ctx = cli_ctx_mock
    
        response = mock.MagicMock()
        response.status_code = 202
        requests_post_mock.return_value = response
    
        get_runtime_config_mock.return_value = {
            "name": "java",
        }
    
        expected_zip_deploy_headers = get_flex_zip_deploy_headers(cmd_mock.cli_ctx)
        get_scm_site_headers_flex_mock.return_value = expected_zip_deploy_headers
    
        # action
        with mock.patch('builtins.open', new_callable=mock.mock_open, read_data='zip-content'):
            enable_zip_deploy_flex(cmd_mock, 'rg', 'name', 'src', slot=None, build_remote=True)
    
        # assert
        requests_post_mock.assert_called_with('https://mock-scm/api/publish?RemoteBuild=True&Deployer=az_cli',&nbsp;data='zip-content',
                                              headers=expected_zip_deploy_headers, verify=mock.ANY)
        # TODO improve authorization matcher
>       check_zip_deployment_status_mock.assert_called_with(cmd_mock, 'rg', 'name',
                                                            'https://mock-scm/api/deployments/latest',&nbsp;None)

src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands_thru_mock.py:253: 
 
 
 
 
 
                                   

self = <MagicMock name='_check_zip_deployment_status_flex' id='139874551799424'>
args = (<azure.cli.core.commands.AzCliCommand object at 0x7f3714d18e90>, 'rg', 'name', 'https://mock-scm/api/deployments/latest',&nbsp;None)
kwargs = {}
expected = call(<azure.cli.core.commands.AzCliCommand object at 0x7f3714d18e90>, 'rg', 'name', 'https://mock-scm/api/deployments/latest',&nbsp;None)
actual = call(<azure.cli.core.commands.AzCliCommand object at 0x7f3714d18e90>, 'rg', 'name', 'https://mock-scm/api/deployments/latest',&nbsp;timeout=None)
_error_message = <function NonCallableMock.assert_called_with.._error_message at 0x7f3714fff740>
cause = None

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\n  Actual: %s'
                    % (expected, actual))
            raise AssertionError(error_message)
    
        def _error_message():
            msg = self._format_mock_failure_message(args, kwargs)
            return msg
        expected = self._call_matcher(_Call((args, kwargs), two=True))
        actual = self._call_matcher(self.call_args)
        if actual != expected:
            cause = expected if isinstance(expected, Exception) else None
>           raise AssertionError(_error_message()) from cause
E           AssertionError: expected call not found.
E           Expected: _check_zip_deployment_status_flex(<azure.cli.core.commands.AzCliCommand object at 0x7f3714d18e90>, 'rg', 'name', 'https://mock-scm/api/deployments/latest',&nbsp;None)
E             Actual: _check_zip_deployment_status_flex(<azure.cli.core.commands.AzCliCommand object at 0x7f3714d18e90>, 'rg', 'name', 'https://mock-scm/api/deployments/latest',&nbsp;timeout=None)

/opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/unittest/mock.py:949: AssertionError
azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands_thru_mock.py:217
❌3.13
Type Test Case Error Message Line
Failed test_enable_zip_deploy_flex self = <azure.cli.command_modules.appservice.tests.latest.test_functionapp_commands_thru_mock.TestFunctionappMocked testMethod=test_enable_zip_deploy_flex>
check_zip_deployment_status_mock = <MagicMock name='check_zip_deployment_status_flex' id='140365809962352'>
requests_post_mock = <function post at 0x7fa9763f0ae0>
get_scm_site_headers_flex_mock = <MagicMock name='get_scm_site_headers_flex' id='140365809963360'>
get_runtime_config_mock = <MagicMock name='get_runtime_config' id='140365809963696'>
get_scm_url_mock = <MagicMock name='get_scm_url' id='140365809964032'>

    @mock.patch('azure.cli.command_modules.appservice.custom.get_scm_url', return_value='https://mock-scm')
    @mock.patch('azure.cli.command_modules.appservice.custom.get_runtime_config')
    @mock.patch('azure.cli.command_modules.appservice.custom.get_scm_site_headers_flex')
    @mock.patch('requests.post', autospec=True)
    @mock.patch('azure.cli.command_modules.appservice.custom.check_zip_deployment_status_flex')
    def test_enable_zip_deploy_flex(self,
                                    check_zip_deployment_status_mock,
                                    requests_post_mock,
                                    get_scm_site_headers_flex_mock,
                                    get_runtime_config_mock,
                                    get_scm_url_mock):
        # prepare
        cmd_mock = get_test_cmd()
        cli_ctx_mock = mock.MagicMock()
        cmd_mock.cli_ctx = cli_ctx_mock
    
        response = mock.MagicMock()
        response.status_code = 202
        requests_post_mock.return_value = response
    
        get_runtime_config_mock.return_value = {
            "name": "java",
        }
    
        expected_zip_deploy_headers = get_flex_zip_deploy_headers(cmd_mock.cli_ctx)
        get_scm_site_headers_flex_mock.return_value = expected_zip_deploy_headers
    
        # action
        with mock.patch('builtins.open', new_callable=mock.mock_open, read_data='zip-content'):
            enable_zip_deploy_flex(cmd_mock, 'rg', 'name', 'src', slot=None, build_remote=True)
    
        # assert
        requests_post_mock.assert_called_with('https://mock-scm/api/publish?RemoteBuild=True&Deployer=az_cli',&nbsp;data='zip-content',
                                              headers=expected_zip_deploy_headers, verify=mock.ANY)
        # TODO improve authorization matcher
>       check_zip_deployment_status_mock.assert_called_with(cmd_mock, 'rg', 'name',
                                                            'https://mock-scm/api/deployments/latest',&nbsp;None)

src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands_thru_mock.py:253: 
 
 
 
 
 
                                   

self = <MagicMock name='_check_zip_deployment_status_flex' id='140365809962352'>
args = (<azure.cli.core.commands.AzCliCommand object at 0x7fa9763dd6a0>, 'rg', 'name', 'https://mock-scm/api/deployments/latest',&nbsp;None)
kwargs = {}
expected = call(<azure.cli.core.commands.AzCliCommand object at 0x7fa9763dd6a0>, 'rg', 'name', 'https://mock-scm/api/deployments/latest',&nbsp;None)
actual = call(<azure.cli.core.commands.AzCliCommand object at 0x7fa9763dd6a0>, 'rg', 'name', 'https://mock-scm/api/deployments/latest',&nbsp;timeout=None)
_error_message = <function NonCallableMock.assert_called_with.._error_message at 0x7fa9763f2b60>
cause = None

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\n  Actual: %s'
                    % (expected, actual))
            raise AssertionError(error_message)
    
        def _error_message():
            msg = self._format_mock_failure_message(args, kwargs)
            return msg
        expected = self._call_matcher(_Call((args, kwargs), two=True))
        actual = self._call_matcher(self.call_args)
        if actual != expected:
            cause = expected if isinstance(expected, Exception) else None
>           raise AssertionError(_error_message()) from cause
E           AssertionError: expected call not found.
E           Expected: _check_zip_deployment_status_flex(<azure.cli.core.commands.AzCliCommand object at 0x7fa9763dd6a0>, 'rg', 'name', 'https://mock-scm/api/deployments/latest',&nbsp;None)
E             Actual: _check_zip_deployment_status_flex(<azure.cli.core.commands.AzCliCommand object at 0x7fa9763dd6a0>, 'rg', 'name', 'https://mock-scm/api/deployments/latest',&nbsp;timeout=None)

/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/unittest/mock.py:979: AssertionError
azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands_thru_mock.py:217
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @kamperiadis,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented Apr 24, 2026

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@github-actions
Copy link
Copy Markdown

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 24, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@yonzhan yonzhan assigned yanzhudd and unassigned zhoxing-ms Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants