Azure / Azure/azure-cli

az functionapp list --output table fails when appServicePlanId is absent

Open
#33,914 2 comments 0 reactions 3 assignees Claimed by @shreyas-gopalakrishna View on GitHub
act-observability-squad Auto-Assign Functions Service Attention
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.