Azure / Azure/azure-cli

`az functionapp create` defaults the `--runtime` flag silently.

Open
#28,225 2 comments 0 reactions 4 assignees Claimed by @kamperiadis View on GitHub
act-observability-squad Auto-Assign azf_bug azf_reviewed Functions Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Related command**
`az functionapp create --functions-version 4` (without specifying `--runtime`)

**Is your feature request related to a problem? Please describe.**
If no runtime is specified, the CLI will choose "dotnet" as per: https://github.com/Azure/azure-cli/blob/a6e9bacd63d3c14fe1547605e752c41d470aa6e4/src/azure-cli/azure/cli/command_modules/appservice/custom.py#L4003

This will target .NET 6 on the in-process model, when for a .NET customer it would be better to target .NET 8 using the "dotnet-isolated" runtime.

This defaulting also occurs silently. The user does not know that they have done this. And if the user DID want to specify something else, they then have to know to go set the `FUNCTIONS_WORKER_RUNTIME` setting.

**Describe the solution you'd like**
An error or at least a strong warning in this case. `--runtime` should basically be required. It's not appropriate to be biasing to one runtime, and we want to ensure `FUNCTIONS_WORKER_RUNTIME` is always set, and set in accordance with user intent.

**Describe alternatives you've considered**
Help text shows using this too aggressively. We could change the text to show other forms. Probably both are required.

**Additional context**
Related to https://github.com/Azure/azure-cli/issues/28224

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.