Skip to content

{App Service} az functionapp function keys list: Fix returning null values with azure-mgmt-web 11.0.0 - #33504

Merged
Julie Zhu (yanzhudd) merged 1 commit into
Azure:devfrom
harshivcodes:functionapp-list-keys
Jun 12, 2026
Merged

Julie Zhu (yanzhudd) merged 1 commit into
Azure:devfrom
harshivcodes:functionapp-list-keys

Conversation

@harshivcodes

@harshivcodes Harshitha Vegaraju (harshivcodes) commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Related command
az functionapp function keys list

Description
az functionapp function keys list returns all-null fields (id, kind, name, properties, type) after the azure-mgmt-web 9.0.0 → 11.0.0 upgrade in #33341.

Root Cause

azure-mgmt-web 11.0.0 regenerated StringDictionary with typespec-python. The new model sets __flattened_items = [""], which fails to lift flat-at-root ARM responses (e.g. {"default": "<key>"}) into .properties. The raw payload is preserved in the model's MutableMapping backing store but .properties returns None.

Fix

In list_function_keys, fall back to dict(keys) when keys.properties is None. This is forward-compatible — if a future SDK release populates .properties correctly, that path is used instead.

Testing Guide

  • Added 2 unit tests in test_functionapp_commands_thru_mock.py
  • Verified end-to-end against a live function app (before: all nulls, after: correct key values)
  • All 32 existing + new mock tests pass
# List function keys (the broken command)
az functionapp function keys list -g <resource-group> -n <functionapp-name> --function-name <function-name>

# With slot
az functionapp function keys list -g <resource-group> -n <functionapp-name> --function-name <function-name> --slot <slot-name>

# Verify these still work (should be unaffected)
az functionapp keys list -g <resource-group> -n <functionapp-name>
az functionapp config appsettings list -g <resource-group> -n <functionapp-name>

Expected (before fix):

{"id": null, "kind": null, "name": null, "properties": null, "type": null}

Expected (after fix):

{"default": "<key-value>"}

This checklist is used to make sure that common guidelines for a pull request are followed.

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 5, 2026

Copy link
Copy Markdown
️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.14
️✔️acs
️✔️latest
️✔️3.12
️✔️3.14
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.14
️✔️ams
️✔️latest
️✔️3.12
️✔️3.14
️✔️apim
️✔️latest
️✔️3.12
️✔️3.14
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.14
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.14
️✔️aro
️✔️latest
️✔️3.12
️✔️3.14
️✔️backup
️✔️latest
️✔️3.12
️✔️3.14
️✔️batch
️✔️latest
️✔️3.12
️✔️3.14
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.14
️✔️billing
️✔️latest
️✔️3.12
️✔️3.14
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.14
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.14
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.14
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.14
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.14
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.14
️✔️config
️✔️latest
️✔️3.12
️✔️3.14
️✔️configure
️✔️latest
️✔️3.12
️✔️3.14
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.14
️✔️container
️✔️latest
️✔️3.12
️✔️3.14
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.14
️✔️core
️✔️latest
️✔️3.12
️✔️3.14
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.14
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.14
️✔️dls
️✔️latest
️✔️3.12
️✔️3.14
️✔️dms
️✔️latest
️✔️3.12
️✔️3.14
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.14
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.14
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.14
️✔️find
️✔️latest
️✔️3.12
️✔️3.14
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.14
️✔️identity
️✔️latest
️✔️3.12
️✔️3.14
️✔️iot
️✔️latest
️✔️3.12
️✔️3.14
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.14
️✔️lab
️✔️latest
️✔️3.12
️✔️3.14
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.14
️✔️maps
️✔️latest
️✔️3.12
️✔️3.14
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.14
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.14
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.14
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.14
️✔️network
️✔️latest
️✔️3.12
️✔️3.14
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.14
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.14
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.14
️✔️profile
️✔️latest
️✔️3.12
️✔️3.14
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.14
️✔️redis
️✔️latest
️✔️3.12
️✔️3.14
️✔️relay
️✔️latest
️✔️3.12
️✔️3.14
️✔️resource
️✔️latest
️✔️3.12
️✔️3.14
️✔️role
️✔️latest
️✔️3.12
️✔️3.14
️✔️search
️✔️latest
️✔️3.12
️✔️3.14
️✔️security
️✔️latest
️✔️3.12
️✔️3.14
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.14
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.14
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.14
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.14
️✔️sql
️✔️latest
️✔️3.12
️✔️3.14
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.14
️✔️storage
️✔️latest
️✔️3.12
️✔️3.14
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.14
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.14
️✔️util
️✔️latest
️✔️3.12
️✔️3.14
️✔️vm
️✔️latest
️✔️3.12
️✔️3.14

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 5, 2026

Copy link
Copy Markdown
️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan

Copy link
Copy Markdown
Collaborator

App Service

@harshivcodes
Harshitha Vegaraju (harshivcodes) marked this pull request as ready for review June 11, 2026 17:11
Copilot AI review requested due to automatic review settings June 11, 2026 17:11

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR addresses an Azure SDK deserialization quirk when listing Function App function keys, ensuring the CLI returns the expected key/value dictionary even when the SDK populates .properties = None.

Changes:

  • Update list_function_keys to fall back to the raw response when .properties is None.
  • Add tests covering both the “broken” flat-dictionary SDK response and the “fixed/enveloped” .properties response.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/azure-cli/azure/cli/command_modules/appservice/custom.py Adds fallback behavior in list_function_keys when .properties is missing/None.
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands_thru_mock.py Adds regression tests to validate the fallback and the normal .properties behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/azure-cli/azure/cli/command_modules/appservice/custom.py
@yanzhudd Julie Zhu (yanzhudd) changed the title [App Service] Fix az functionapp function keys list returning null values with azure-mgmt-web 11.0.0 {App Service} az functionapp function keys list: Fix returning null values with azure-mgmt-web 11.0.0 Jun 12, 2026
@yanzhudd
Julie Zhu (yanzhudd) merged commit 1cb2aed into Azure:dev Jun 12, 2026
52 checks passed
Copilot AI mentioned this pull request Jun 17, 2026
@patelchandni

Copy link
Copy Markdown
Contributor

This PR fixes issue: #33516

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants