[App Service] Update functionapp config ssl commands for flex consumption and functionapp flex-migration commands#33443
Conversation
️✔️AzureCLI-FullTest
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| functionapp config ssl delete | cmd functionapp config ssl delete added parameter name |
||
| functionapp config ssl import | cmd functionapp config ssl import added parameter enable_using_msi |
||
| functionapp config ssl import | cmd functionapp config ssl import added parameter load_to_code |
||
| functionapp config ssl list | cmd functionapp config ssl list added parameter name |
||
| functionapp config ssl show | cmd functionapp config ssl show added parameter name |
||
| functionapp config ssl upload | cmd functionapp config ssl upload added parameter load_to_code |
||
| webapp config ssl delete | cmd webapp config ssl delete added parameter name |
||
| webapp config ssl import | cmd webapp config ssl import added parameter enable_using_msi |
||
| webapp config ssl import | cmd webapp config ssl import added parameter load_to_code |
||
| webapp config ssl list | cmd webapp config ssl list added parameter name |
||
| webapp config ssl show | cmd webapp config ssl show added parameter name |
||
| webapp config ssl upload | cmd webapp config ssl upload added parameter load_to_code |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull request overview
This PR updates App Service Function App SSL certificate flows and Flex migration behavior to better support Flex Consumption, primarily by switching Flex apps to site-scoped certificate operations and by allowing migration with certificate-related warnings instead of hard failures.
Changes:
- Updated Flex migration eligibility checks to emit warning notes (SSL bindings /
WEBSITE_LOAD_CERTIFICATES) rather than blocking migration. - Added Flex-specific SSL parameters and logic (e.g.,
--load-to-code,--enable-using-msi, optional--namefor certainfunctionapp config sslcommands). - Adjusted tests and recordings to reflect the new behavior and API interactions.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/appservice/custom.py |
Adds Flex-aware certificate handling (site-scoped cert APIs) and changes flex-migration eligibility to warnings; introduces new params support in certificate upload/import/bind logic. |
src/azure-cli/azure/cli/command_modules/appservice/_params.py |
Adds/extends CLI arguments for Function App SSL commands to support Flex Consumption scenarios. |
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py |
Updates a mock-based test to account for is_flex_functionapp usage. |
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py |
Updates Flex migration live tests to expect eligibility-with-warning behavior for cert-related scenarios. |
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_webapp_ssl_specify_hostname.yaml |
Updates recorded HTTP interactions for SSL upload/bind/unbind flows. |
Comments suppressed due to low confidence (1)
src/azure-cli/azure/cli/command_modules/appservice/custom.py:6767
upload_ssl_certopens the certificate file withopen()but never closes it. Please use a context manager (with open(...) as f:) to avoid leaking file descriptors, especially in long-running CLI sessions/tests.
webapp = _generic_site_operation(cmd.cli_ctx, resource_group_name, name, 'get', slot)
cert_file = open(certificate_file, 'rb')
cert_contents = cert_file.read()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| warnings.append("The site '{}' is using TSL/SSL certificates. " | ||
| "Site-scoped TSL/SSL certificates are supported in Flex Consumption in preview. " |
| self.assertTrue(eligible_ssl_functionapp_name in candidate_names) | ||
| ssl_candidate = next((c for c in candidates if c.get('name') == eligible_ssl_functionapp_name), None) | ||
| self.assertIsNotNone(ssl_candidate) | ||
| self.assertIn('TSL/SSL certificates', ssl_candidate.get('note', '')) |
Related command
az functionapp config ssl
az functionapp flex-migration
Description
_params.pycustom.pyaz functionapp config ssl- Updated the following functions to support Flex Consumption apps by using site-scoped certificates (client.site_certificates.) instead of resource group-scoped certificates (client.certificates.):az functionapp flex-migrationtest_webapp_commands_thru_mock.pytest_functionapp_commands.pyTesting Guide
History Notes
[App Service]
az functionapp config ssl: Support site-scoped certificates for Flex consumption[App Service]
az functionapp flex-migration: Allow migrating Linux consumption apps with certificatesThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.