az functionapp list --output table fails when appServicePlanId is absent
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
## Summary
`az functionapp list --output table` fails when any Function App response omits `appServicePlanId`. JSON output succeeds.
## Reproduction
```bash
az version
# azure-cli 2.89.1
az functionapp list --output table
```
## Actual result
```text
ERROR: Table output unavailable. Use the --query option to specify an appropriate query. Use --debug for more info.
```
The debug traceback identifies the underlying failure:
```text
File "azure/cli/command_modules/appservice/commands.py", line 35, in transform_web_output
result["appServicePlan"] = result.pop("appServicePlanId").split("/")[-1]
KeyError: 'appServicePlanId'
```
## Expected result
`az functionapp list --output table` should render the Function Apps list without failing when `appServicePlanId` is missing. The formatter should tolerate an omitted optional field.
## Workaround
Explicitly project fields before requesting table output:
```bash
az functionapp list --query '[].{Name:name,ResourceGroup:resourceGroup,Location:location,State:state}' --output table
```
## Related issues
- #33516: `az functionapp function keys list` broken in 2.87.0
- #16698: `az functionapp list` returns incorrect null values
This may be another regression in the Function App output/transform layer introduced around 2.87.0.
Contributor guide
Assessment
This issue has not been assessed yet.