{App Service} az functionapp create: Stack API to take SKU for Flex#32264
{App Service} az functionapp create: Stack API to take SKU for Flex#32264
az functionapp create: Stack API to take SKU for Flex#32264Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
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
Adds generic SKU-aware runtime stack helper to replace the previous Flex-only helper so that Function App stack resolution can work for Flex Consumption (FC1) and future SKUs. Key change introduces _FunctionAppSkuStackRuntimeHelper with a sku parameter and updates all call sites accordingly.
- Introduces new helper class _FunctionAppSkuStackRuntimeHelper and replaces prior _FlexFunctionAppStackRuntimeHelper usages.
- Modifies the stacks API URL to attempt adding a sku query parameter.
- Removes hardcoded filtering for FC1 skus in stack parsing.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| for sku in skus: | ||
| if sku['skuCode'] != 'FC1': | ||
| continue | ||
|
|
||
| github_actions_properties = { | ||
| 'is_supported': github_actions_settings.get('isSupported', False), |
There was a problem hiding this comment.
Removing the prior FC1 filter means multiple skus can iterate but the logic later assigns runtime_to_version[runtime_name][runtime_version] once, overwriting earlier sku entries and yielding a nondeterministic sku selection. Either (a) restore filtering to the requested sku, (b) key runtime_to_version by (runtime_version, skuCode), or (c) ensure the API correctly filters by sku (after fixing the URL) so only one sku is returned.
| def __init__(self, cmd, location, runtime, sku, runtime_version=None): | ||
| self._cmd = cmd | ||
| self._location = location | ||
| self._runtime = runtime | ||
| self._sku = sku | ||
| self._runtime_version = runtime_version |
There was a problem hiding this comment.
The attribute self._runtime_version is assigned but never referenced elsewhere in the class; remove it or use it (e.g., to default resolve logic) to avoid dead code and reduce confusion.
| def __init__(self, cmd, location, runtime, sku, runtime_version=None): | |
| self._cmd = cmd | |
| self._location = location | |
| self._runtime = runtime | |
| self._sku = sku | |
| self._runtime_version = runtime_version | |
| def __init__(self, cmd, location, runtime, sku): | |
| self._cmd = cmd | |
| self._location = location | |
| self._runtime = runtime | |
| self._sku = sku |
|
please fix the CI issues |
|
please note that the code completion date is on 10/28/2025 at 07:00 UTC for the upcoming release. Please address the comments asap, otherwise it has to be postponed to next sprint (11/18) |
May I ask why the title uses |
az functionapp create: Stack API to take SKU for Flexaz functionapp create: Stack API to take SKU for Flex
f6f5210 to
ee2abec
Compare
| stacks_api_url = '/providers/Microsoft.Web/locations/{}/functionAppStacks?' \ | ||
| 'api-version=2020-10-01&removeHiddenStacks=true&removeDeprecatedStacks=true&stack={}' | ||
| def get_raw_function_app_stacks(self, cmd, location, runtime, sku): | ||
| stacks_api_url = '/providers/Microsoft.Web/locations/{}/functionAppStacks?api-version=2023-01-01&removeHiddenStacks=true&removeDeprecatedStacks=true&stack={}&sku={}' # pylint: disable=line-too-long |
There was a problem hiding this comment.
Instead of passing "FC1" from every calling function, why don't you just make it so that this url is
stacks_api_url = '/providers/Microsoft.Web/locations/{}/functionAppStacks?api-version=2023-01-01&removeHiddenStacks=true&removeDeprecatedStacks=true&stack={}&sku=FC1'
This way, we don't have to update all existing functions. I think we should only accept a sku param to the RuntimeHelper class and methods if this class is used for stuff other than flex and this sku value can vary based on those applications. But my understanding is that all of this is for flex and we would have to use the same sku value right?
There was a problem hiding this comment.
Made the class as generic in terms of SKU because the stacks API is not Flex specific anymore.
There was a problem hiding this comment.
Changed as recommended. Will make the class generic in a different PR. thanks!
3b33f51 to
e84fa69
Compare
|
|
||
| @ResourceGroupPreparer(location=LINUX_ASP_LOCATION_FUNCTIONAPP) | ||
| @StorageAccountPreparer() | ||
| def test_functionapp_on_linux_consumption_python_latest(self, resource_group, storage_account): |
There was a problem hiding this comment.
How is this test relevant in testing the changes you made in custom.py if that _FlexFunctionAppStackRuntimeHelper class is for Flex specific apps?
There was a problem hiding this comment.
For context: The test was removed by azcli team because it was breaking and blocking the PRs. I am adding the adding the test back after fixing it as part of the PR. thanks!
az functionapp create: Stack API to take SKU for Flexaz functionapp create: Stack API to take SKU for Flex
Related command
Description
Updated the stacks API to take SKU as parameter/query string. Also make the Flex specific stacks API class to be generic and able to take SKU as input.
Testing Guide
az functionapp list-flexconsumption-locations
This 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.