[AppService] Restore appServicePlanId in az webapp show/list output#33733
appServicePlanId in az webapp show/list output#33733Conversation
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
appServicePlanId in az webapp show/list output
Live test results —
|
There was a problem hiding this comment.
Automated Review Summary
Live test: ✅ Passed
CI checks: ✅ 1/1 passed, 0 pending, 0 failed
All automated checks are green for this PR at the current head commit. No further action needed from the agent at this time.
Posted by agent-assist (autonomous bug-fix pipeline).
|
AppService |
There was a problem hiding this comment.
CI Failure Summary
The following checks failed on this PR:
❌ Failed Checks
Azure.azure-cli (Test Homebrew Formula)— The Homebrew formula test suite failed.Azure.azure-cli— The overall Azure DevOps pipeline check failed (rolls up the Homebrew failure).
Root Cause Analysis
The PR adds test_rename_server_farm_props_handles_mutable_mapping which sets site['serverFarmId'] = ... directly on a Site model instance from azure.mgmt.web.models. The Homebrew formula test environment pins a specific version of azure-mgmt-web; in that pinned version, Site objects may not support dict-style item assignment (__setitem__), causing either a TypeError on site['serverFarmId'] = ... or causing isinstance(site, MutableMapping) to return False, which would make _rename_server_farm_props fall through to the setattr branch instead of the dict branch — and the test assertion site['appServicePlanId'] would then fail.
Required Fix
-
Decouple the test from the real
SiteSDK model. Replace theSite(location='westus')instance with a plainMutableMappingmock (e.g., a simpledict) so the test exercises_rename_server_farm_propswithout depending on the SDK version installed in the Homebrew formula environment.# Before (SDK-version-dependent) site = Site(location='westus') site['serverFarmId'] = '...' # After (SDK-independent) site = {'serverFarmId': '...', 'location': 'westus'}
-
Remove the now-unused
from azure.mgmt.web.models import Siteimport to eliminate the environment-version risk. -
Verify locally that
python -m pytest --pyargs azure.cli.command_modules.appservicepasses before pushing.
Posted by agent-assist (autonomous bug-fix pipeline).
|
@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes and push a fix. Posted by agent-assist (autonomous bug-fix pipeline). |
Fixed in |
Live test results —
|
Live test results —
|
There was a problem hiding this comment.
Automated Review Summary
Live test (azdev --live): ✅ Passed
CI checks: ✅ All 20 checks passed (0 failed, 0 pending)
No issues found. This PR appears ready for human maintainer review/merge decision.
Posted by agent-assist (autonomous bug-fix pipeline).
Related command
az webapp listaz webapp showDescription
az webapp listandaz webapp showregressed to returningserverFarmIdinstead of the long-standingappServicePlanIdfield after the newer Web SDK model shape was introduced. This change restores the compatibility shim so CLI output keeps the expected contract.Output compatibility
_rename_server_farm_propsto handle newer mutable-mapping SDK models by writingappServicePlanIddirectly into the serialized shape.serverFarmIdfrom that output path soshow/listmatch prior CLI behavior.Legacy path preserved
Regression coverage
Testing Guide
Expected: both commands return
appServicePlanId;serverFarmIdis no longer surfaced in the CLI output contract for these commands.History Notes
[AppService]
az webapp show/list: RestoreappServicePlanIdoutput field compatibilityThis 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.