[Appservice] az functionapp create: Auto-register Microsoft.App provider for Flex Consumption apps#33331
[Appservice] az functionapp create: Auto-register Microsoft.App provider for Flex Consumption apps#33331
az functionapp create: Auto-register Microsoft.App provider for Flex Consumption apps#33331Conversation
️✔️AzureCLI-FullTest
|
❌AzureCLI-BreakingChangeTest
Please submit your Breaking Change Pre-announcement ASAP if you haven't already. Please note:
|
… app creation Agent-Logs-Url: https://github.com/Azure/azure-cli/sessions/6d1391c2-c0c3-48a2-b291-73e03af3a13c Co-authored-by: a0x1ab <59631311+a0x1ab@users.noreply.github.com>
az functionapp create: Auto-register Microsoft.App provider for Flex Consumption apps
a0x1ab
left a comment
There was a problem hiding this comment.
🤖 AI Agent | This comment was posted automatically by the GitHub Copilot agent assist loop.
✅ Reviewer — PR #33331 Code Review Passed
Issue: #33177 — Flex Consumption Function App creation does not enforce Microsoft.App resource provider registration
Code Review Results
Changes in custom.py (3 lines):
- ✅
--planpath:if plan_info.sku and plan_info.sku.tier and plan_info.sku.tier.lower() == 'flexconsumption': register_app_provider(cmd)— safe None-guards before attribute access, case-insensitive comparison - ✅
--flexconsumption-locationpath:register_app_provider(cmd)moved to run unconditionally after location validation, not just inside VNet block
Tests in test_functionapp_commands_thru_mock.py (181 lines, 4 scenarios):
- ✅
--flexconsumption-locationwithout VNet →register_app_providercalled once - ✅
--flexconsumption-locationwith VNet →register_app_providercalled - ✅
--planwithFlexConsumptiontier →register_app_providercalled once - ✅
--planwithStandardtier →register_app_providernot called
Note: Azure VM-based testing was blocked (no credentials in agent environment). CI checks were in-progress at review time — please verify all checks pass before merging. PR is currently a draft.
|
Appservice |
Related command
az functionapp createDescription
When creating a Flex Consumption Function App,
Microsoft.Appresource provider was never registered — even though the portal and CLI are documented to enforce this. The missing registration causes failures later when enabling VNet integration withMicrosoft.App/environmentssubnet delegation.Changes:
--flexconsumption-locationpath:register_app_provider(cmd)is now called unconditionally in theelif flexconsumption_location:branch. Previously it was only called from within the VNet integration block, leaving non-VNet creation paths unregistered.--planpath with FlexConsumption SKU:register_app_provider(cmd)is now called when the resolved plan hassku.tier == 'FlexConsumption', covering users who pass an existing FC1 plan via--plan.Testing Guide
Unit tests added in
test_functionapp_commands_thru_mock.py::TestCreateFunctionAppFlexProviderRegistration:# Run the new unit tests python -m pytest src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands_thru_mock.py::TestCreateFunctionAppFlexProviderRegistration -vCovers:
--flexconsumption-locationwithout VNet → provider registered--flexconsumption-locationwith VNet → provider registered--planwith FlexConsumption tier → provider registered--planwith non-FlexConsumption tier → provider not registeredHistory Notes
[Appservice]
az functionapp create: Auto-registerMicrosoft.Appresource provider when creating Flex Consumption function apps to prevent later VNet integration failuresThis 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.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
azcliprod.blob.core.windows.net/usr/bin/python python -m pytest src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands_thru_mock.py::TestCreateFunctionAppFlexProviderRegistration -v(dns block)If you need me to access, download, or install something from one of these locations, you can either: