[App Service]az appservice plan create: Add default OS as Linux#33395
[App Service]az appservice plan create: Add default OS as Linux#33395Shi1810 wants to merge 3 commits into
az appservice plan create: Add default OS as Linux#33395Conversation
️✔️AzureCLI-FullTest
|
|
Hi @Shi1810, |
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| appservice plan create | cmd appservice plan create update parameter is_linux: added property choices=['false', 'true'] |
||
| appservice plan create | cmd appservice plan create update parameter is_linux: added property nargs=? |
|
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>
|
az appservice plan create: Added default OS as Linux
az appservice plan create: Added default OS as Linuxaz appservice plan create: Add default OS as Linux
There was a problem hiding this comment.
Pull request overview
This PR changes the default behavior of az appservice plan create so that, when --is-linux is not specified, plans default to Linux instead of Windows, while aiming to keep --hyper-v scenarios Windows-only.
Changes:
- Updated
--is-linuxto a three-state flag and set its default totrue, enabling--is-linux falsefor Windows plans. - Added validation logic to force
is_linux=Falsewhen--hyper-vis specified.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/appservice/_validators.py |
Forces is_linux=False when --hyper-v is set before SKU defaulting/validation. |
src/azure-cli/azure/cli/command_modules/appservice/_params.py |
Changes --is-linux to a three-state flag with default true, and updates help text to mention --is-linux false. |
Comments suppressed due to low confidence (2)
src/azure-cli/azure/cli/command_modules/appservice/_params.py:131
- Changing
--is-linuxto default true will flip the default plan OS for many existing scenario tests that callappservice plan createwithout--is-linux(e.g., tests that later create Windows webapps/functions on that plan). Please add/update tests to explicitly set--is-linux falsewhere Windows is expected and add coverage for the new default +--hyper-vbehavior.
c.argument('is_linux', arg_type=get_three_state_flag(), default=True, required=False,
help='Host web app on Linux worker. Defaults to true. Use "--is-linux false" to create a Windows plan.')
c.argument('hyper_v', action='store_true', required=False, help='Host Windows Container Web App on Hyper-V worker.')
src/azure-cli/azure/cli/command_modules/appservice/_params.py:130
- The updated help text for
--is-linuxstill says "Host web app on Linux worker", but this argument applies to the App Service plan. Consider rewording to refer to the plan (and keep capitalization consistent with other help strings).
c.argument('is_linux', arg_type=get_three_state_flag(), default=True, required=False,
help='Host web app on Linux worker. Defaults to true. Use "--is-linux false" to create a Windows plan.')
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| c.argument('is_linux', arg_type=get_three_state_flag(), default=True, required=False, | ||
| help='Host web app on Linux worker. Defaults to true. Use "--is-linux false" to create a Windows plan.') |
az appservice plan create: Add default OS as Linuxaz appservice plan create: Add default OS as Linux
Related command
az appservice plan createDescription
Changes the default OS for
az appservice plan createfrom Windows to Linux.Linux is the dominant platform for Python and Node.js workloads on App Service, which represent the majority of CLI usage. This aligns the default with what most users expect and reduces friction for the most common scenarios. For .NET users, Windows remains available via
--is-linux false.When
--hyper-vis specified, we Keep the default OS as Windows only.Testing Guide
az appservice plan create -g rg-islinux-test -n plan-default-test --sku B1
az appservice plan create -g rg-islinux-test -n plan-windows-test --is-linux false --sku B1
az appservice plan create -g rg-islinux-test -n plan-hyperv-test --hyper-v --sku P1V3
az appservice plan create -g rg-islinux-test -n plan-explicit-linux --is-linux true --sku B1

History Notes
[App Service]
az appservice plan create: Make default OS as Linux when--hyper-vis not specified explicitly[App Service]
az appservice plan create: Use--is-linux falseto create a Windows app service planThis 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.