Skip to content

[AppService] az appservice plan create: Fix Windows defaults for App Service managed instance plans - #34110

Open
Andrew Westgarth (apwestgarth) wants to merge 2 commits into
Azure:devfrom
apwestgarth:linuxdefault-managedinstancefix
Open

Andrew Westgarth (apwestgarth) wants to merge 2 commits into
Azure:devfrom
apwestgarth:linuxdefault-managedinstancefix

Conversation

@apwestgarth

@apwestgarth Andrew Westgarth (apwestgarth) commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

🤖 PR Validation — ️✔️ All clear

Breaking Changes Tests
️✔️ None ️✔️ 130/130

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.

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.

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.
Copilot AI lite review requested due to automatic review settings September 21, 2026 18:40
@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi Andrew Westgarth (@apwestgarth),
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity

Open (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.

Comment thread src/azure-cli/azure/cli/command_modules/appservice/custom.py
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
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.
@apwestgarth

Copy link
Copy Markdown
Member Author

Shi1810 requested review in light of your original changes in #33395

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@yonzhan

Copy link
Copy Markdown
Collaborator

appservice

@a0x1ab Aditya Pujara (a0x1ab) added the Request X Engineering Agent Request X Engineering Agent testing and review label Sep 22, 2026
@x-engineering-agent

Copy link
Copy Markdown
Contributor

Live test results — azdev test --live --series (changed test files only)

✅ PASS

Selectors: appservice.test_appservice_validators_thru_mock appservice.TestCreateAppServicePlanDefaults (module)
PR head ref: linuxdefault-managedinstancefix
PR head sha: 4a15ce0c4a26f9c8f96c15831b0fb4b8672d4ea3
PR base ref: dev
New test files in PR: false

Changed test files run
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/35705260012

Last 80 lines of azdev output

=============
| Run Tests |
=============


test index found: /home/runner/.azdev/env_config/home/runner/work/issue-sentinel/issue-sentinel/.venv/test_index/latest.json

Test on modules: appservice.test_appservice_validators_thru_mock, appservice.TestCreateAppServicePlanDefaults

WARNING: RUNNING TESTS LIVE
The tests are set to run against current profile "latest"
============================= test session starts ==============================
platform linux -- Python 3.12.14, pytest-9.1.1, pluggy-1.6.0 -- /home/runner/work/issue-sentinel/issue-sentinel/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli
plugins: forked-1.7.5, xdist-3.8.0
collecting ... collected 40 items

azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateAppServicePlanCreateTest::test_managed_instance_defaults_to_windows PASSED [  2%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateAppServicePlanCreateTest::test_managed_instance_rejects_hyper_v PASSED [  5%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateAppServicePlanCreateTest::test_managed_instance_rejects_linux PASSED [  7%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateAppServicePlanSkuTest::test_isolated_v4_skus_are_supported_for_ase_plans PASSED [ 10%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateAppServicePlanSkuTest::test_isolated_v4_skus_require_ase PASSED [ 12%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateAppServicePlanSkuTest::test_isolated_v4_skus_support_zone_redundancy PASSED [ 15%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::NormalizeHttpHeadersTest::test_cli_and_sdk_forms_compare_equal PASSED [ 17%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::NormalizeHttpHeadersTest::test_cli_form_lowercases_header_names PASSED [ 20%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::NormalizeHttpHeadersTest::test_cli_form_repeated_names_accumulate PASSED [ 22%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::NormalizeHttpHeadersTest::test_drops_empty_values PASSED [ 25%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::NormalizeHttpHeadersTest::test_ignores_malformed_cli_entries_without_equals PASSED [ 27%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::NormalizeHttpHeadersTest::test_none_and_empty_normalize_equally PASSED [ 30%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::NormalizeHttpHeadersTest::test_sdk_form_value_order_insensitive PASSED [ 32%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::NormalizeIpAddressListTest::test_empty_inputs PASSED [ 35%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::NormalizeIpAddressListTest::test_order_independent PASSED [ 37%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::NormalizeIpAddressListTest::test_single_cidr PASSED [ 40%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::NormalizeIpAddressListTest::test_strips_whitespace_around_entries PASSED [ 42%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateIpAddressExistenceTest::test_allows_different_ip PASSED [ 45%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateIpAddressExistenceTest::test_allows_same_ip_with_different_xff PASSED [ 47%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateIpAddressExistenceTest::test_allows_same_ip_with_headers_vs_no_headers PASSED [ 50%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateIpAddressExistenceTest::test_blocks_exact_duplicate_no_headers PASSED [ 52%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateIpAddressExistenceTest::test_blocks_same_ip_and_identical_headers PASSED [ 55%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateIpAddressExistenceTest::test_blocks_when_value_order_differs_for_same_header PASSED [ 57%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateIpAddressExistenceTest::test_handles_none_access_rules PASSED [ 60%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateIpAddressExistenceTest::test_multi_ip_allows_when_set_differs PASSED [ 62%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateIpAddressExistenceTest::test_multi_ip_blocks_when_order_differs_but_set_matches PASSED [ 65%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateIpAddressExistenceTest::test_namespace_without_http_headers_attr PASSED [ 67%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateIpAddressExistenceTest::test_scm_path_is_isolated_from_main PASSED [ 70%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateServiceTagExistenceTest::test_allows_same_tag_with_different_fdid PASSED [ 72%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateServiceTagExistenceTest::test_blocks_exact_duplicate PASSED [ 75%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateServiceTagExistenceTest::test_blocks_when_tag_and_headers_match PASSED [ 77%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_appservice_validators_thru_mock.py::ValidateServiceTagExistenceTest::test_handles_none_access_rules PASSED [ 80%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py::TestCreateAppServicePlanDefaults::test_default_sku_is_p0v3_when_not_specified PASSED [ 82%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py::TestCreateAppServicePlanDefaults::test_is_linux_false_creates_windows_plan PASSED [ 85%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py::TestCreateAppServicePlanDefaults::test_is_linux_none_defaults_to_linux PASSED [ 87%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py::TestCreateAppServicePlanDefaults::test_managed_instance_defaults_to_windows PASSED [ 90%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py::TestCreateAppServicePlanDefaults::test_managed_instance_rejects_hyper_v PASSED [ 92%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py::TestCreateAppServicePlanDefaults::test_managed_instance_rejects_linux PASSED [ 95%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py::TestCreateAppServicePlanDefaults::test_update_to_isolated_v4_sku_on_ase PASSED [ 97%]
azure-cli/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py::TestCreateAppServicePlanDefaults::test_update_to_isolated_v4_sku_requires_ase PASSED [100%]

- generated xml file: /home/runner/work/issue-sentinel/issue-sentinel/test-output/results.xml -
============================== 40 passed in 0.85s ==============================

Posted by the X Engineering Agent live-test workflow.

@x-engineering-agent x-engineering-agent Bot changed the title [App Service]] az appservice plan create - Fix Windows defaults for App Service managed instance plans [AppService] az appservice plan create: ] - Fix Windows defaults for App Service managed instance plans Sep 22, 2026
@x-engineering-agent x-engineering-agent Bot changed the title [AppService] az appservice plan create: ] - Fix Windows defaults for App Service managed instance plans [AppService] az appservice plan create: Fix Windows defaults for App Service managed instance plans Sep 22, 2026
x-engineering-agent[bot]

This comment was marked as resolved.

@x-engineering-agent x-engineering-agent Bot added the X Engineering Agent Reviewed Pull request reviewed by X Engineering Agent label Sep 22, 2026
x-engineering-agent[bot]

This comment was marked as resolved.

x-engineering-agent[bot]

This comment was marked as resolved.

x-engineering-agent[bot]

This comment was marked as resolved.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Request X Engineering Agent Request X Engineering Agent testing and review X Engineering Agent Reviewed Pull request reviewed by X Engineering Agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants