-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Related command
az functionapp create --functions-version 4 --runtime <runtime> (without also setting --runtime-version)
Is your feature request related to a problem? Please describe.
The current version resolution logic only looks for the default property:
| runtimes.sort(key=lambda r: r.default, reverse=True) # make runtimes with default=True appear first |
Dotnet is an example of a stack that has two values for the runtime setting, but only one of those can have the default property. In the absence of the default flag being present, the order from the Stacks API seems to be used. I'm not sure if that sort method would have any other side effects.
This has had the effect of making the default for the dotnet-isolated runtime .NET Framework 4.8, which has never been the desired default for that runtime. But it also creates the possible trap where the CLI could start defaulting to things that are nearing EOL when a better supported option is present for any given stack. This issue requests changes to protect against those situations.
Describe the solution you'd like
The sorting should account for the endOfLifeDate property in the Stacks API and choose sort based on the date, prioritizing the furthest away. Absence of the endOfLifeDate property (as for .NET Framework 4.8 or if someone should forget to note it for a given stack) should be treated as a minimum date and appear last in sorting.
Describe alternatives you've considered
We will also ensure the Stacks API itself is properly sorted for .NET, but ideally we have the combination of these. The .NET entries have been updated to put the default in place for dotnet-isolated, specifically,
Additional context
It would be worth confirming that this behavior would work for the other stacks as well.