Skip to content

[Appservice] az functionapp create: Auto-register Microsoft.App provider for Flex Consumption apps#33331

Draft
Copilot wants to merge 2 commits intodevfrom
copilot/fix-flex-consumption-function-app-registration
Draft

[Appservice] az functionapp create: Auto-register Microsoft.App provider for Flex Consumption apps#33331
Copilot wants to merge 2 commits intodevfrom
copilot/fix-flex-consumption-function-app-registration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 8, 2026

Related command
az functionapp create

Description

When creating a Flex Consumption Function App, Microsoft.App resource 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 with Microsoft.App/environments subnet delegation.

Changes:

  • --flexconsumption-location path: register_app_provider(cmd) is now called unconditionally in the elif flexconsumption_location: branch. Previously it was only called from within the VNet integration block, leaving non-VNet creation paths unregistered.
  • --plan path with FlexConsumption SKU: register_app_provider(cmd) is now called when the resolved plan has sku.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 -v

Covers:

  • --flexconsumption-location without VNet → provider registered
  • --flexconsumption-location with VNet → provider registered
  • --plan with FlexConsumption tier → provider registered
  • --plan with non-FlexConsumption tier → provider not registered

History Notes

[Appservice] az functionapp create: Auto-register Microsoft.App resource provider when creating Flex Consumption function apps to prevent later VNet integration failures


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

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
    • Triggering command: /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:

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

azure-client-tools-bot-prd Bot commented May 8, 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
️✔️3.13
️✔️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

azure-client-tools-bot-prd Bot commented May 8, 2026

❌AzureCLI-BreakingChangeTest
❌appservice
rule cmd_name rule_message suggest_message
1007 - ParaRemove webapp list-runtimes cmd webapp list-runtimes removed parameter runtime please add back parameter runtime for cmd webapp list-runtimes
1007 - ParaRemove webapp list-runtimes cmd webapp list-runtimes removed parameter support please add back parameter support for cmd webapp list-runtimes
⚠️ 1006 - ParaAdd webapp list-runtimes cmd webapp list-runtimes added parameter linux
⚠️ 1006 - ParaAdd webapp list-runtimes cmd webapp list-runtimes added parameter show_runtime_details

Please submit your Breaking Change Pre-announcement ASAP if you haven't already. Please note:

  • Breaking changes can only be merged during the designated breaking change window
  • A pre-announcement must be released at least one month in advance

For more details on how to introduce breaking changes, refer to the documentation: azure-cli/doc/how_to_introduce_breaking_changes.md

Copilot AI changed the title [WIP] Fix Azure CLI to enforce Microsoft.App resource provider registration [Appservice] az functionapp create: Auto-register Microsoft.App provider for Flex Consumption apps May 8, 2026
Copilot finished work on behalf of a0x1ab May 8, 2026 05:26
Copilot AI requested a review from a0x1ab May 8, 2026 05:26
Copy link
Copy Markdown
Member

@a0x1ab a0x1ab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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):

  • --plan path: 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-location path: 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-location without VNet → register_app_provider called once
  • --flexconsumption-location with VNet → register_app_provider called
  • --plan with FlexConsumption tier → register_app_provider called once
  • --plan with Standard tier → register_app_provider not 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.

@yonzhan yonzhan assigned yanzhudd and unassigned zhoxing-ms May 8, 2026
@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 8, 2026

Appservice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-codegen-extensibility-squad act-identity-squad ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Auto-Assign Auto assign by bot Portal az portal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flex Consumption Function App creation does not enforce Microsoft.App resource provider registration

6 participants