[AppService] az appservice plan create: Fix Windows defaults for App Service managed instance plans - #34110
Conversation
Default App Service plans to Windows when --is-managed-instance is specified without --is-linux. Reject unsupported argument combinations: - --is-managed-instance with --is-linux true - --hyper-v with --is-managed-instance Update parameter help and add unit tests covering the managed instance Windows default and mutual-exclusion validation.
|
Hi Andrew Westgarth (@apwestgarth), |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The registered validator still overrides the managed-instance default and emits the existing conflict message; current tests bypass that command path.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
What changed in this PR
Updates az appservice plan create to support Windows defaults for managed-instance plans and reject unsupported option combinations.
Changes:
- Adds managed-instance defaulting and validation.
- Updates parameter help text.
- Adds focused unit tests.
| File | Summary |
|---|---|
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py |
Adds tests for defaults and validation. |
src/azure-cli/azure/cli/command_modules/appservice/custom.py |
Adds managed-instance handling and conflict checks. |
src/azure-cli/azure/cli/command_modules/appservice/_params.py |
Updates parameter guidance. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Default App Service plans to Windows when --is-managed-instance is specified without --is-linux. Update both the command validator and create handler to reject unsupported argument combinations: - --is-managed-instance with --is-linux true - --hyper-v with --is-managed-instance - --hyper-v with --is-linux true Update parameter help and add focused validator and handler unit tests for the Windows defaults and mutual-exclusion rules.
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
appservice |
Live test results —
|
az appservice plan create: ] - Fix Windows defaults for App Service managed instance plans
az appservice plan create: ] - Fix Windows defaults for App Service managed instance plansaz appservice plan create: Fix Windows defaults for App Service managed instance plans

🤖 PR Validation — ️✔️ All clear
Default App Service plans to Windows when --is-managed-instance is specified without --is-linux.
Reject unsupported argument combinations:
Update parameter help and add unit tests covering the managed instance Windows default and mutual-exclusion validation.
Related command
az appservice plan create
Description
Recent change in July changed default OS on App Service Plan creation from Windows to Linux. Original change handled situations where user specified --hyper-v to signify the plan was for Windows Containers and therefore must default to Windows. However this change did not handle Managed Instance on Azure App Service (--is-managed-instance) which is only available on Windows OS. Equally added change to ensure that neither --hyper-v or --is-managed-instance can be accepted when --is-linux but also added check to ensure the --hyper-v cannot be set on --is-managed-instance as Windows Containers are not supported in Managed Instance on Azure App Service
Testing Guide
App Service Plan for Windows Containers should default to Windows(--is-linux false)
az appservice plan create -n -l ---sku P1v4 --hyper-v
Managed Instance on Azure App Service Plan should default to Windows (--is-linux false)
az appservice plan create -n -l --sku P1v4 --is-managed-instance
Managed Instance on Azure App Service does not support Windows Containers so the following command should error
az appservice plan create -n -l --sku P1v4 --is-managed-instance --hyper-v
Error Message: --hyper-v and --is-managed-instance cannot be used together because Windows Containers are not supported in Managed Instance on Azure App Service.
Windows Containers cannot be hosted in a Linux App Service plan so the following command should error
az appservice plan create -n -l --sku P1v4 --hyper-v --is-linux true
Error Message: --hyper-v creates a Windows plan and cannot be combined with --is-linux true. Omit --is-linux or use "--is-linux false".
Managed Instance does not support Linux so the following command should error
az appservice plan create -n -l --sku P1v4 --is-managed-instance --is-linux true
Error Message: --is-managed-instance creates a Windows plan and cannot be combined with --is-linux true. Omit --is-linux or use "--is-linux false".
History Notes
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.