Skip to content

List site-scoped certificates for Flex Consumption apps in az webapp config ssl list#33571

Open
ElleTojaroon wants to merge 2 commits into
Azure:devfrom
ElleTojaroon:user/et/ssl-list-flex-site-certs
Open

List site-scoped certificates for Flex Consumption apps in az webapp config ssl list#33571
ElleTojaroon wants to merge 2 commits into
Azure:devfrom
ElleTojaroon:user/et/ssl-list-flex-site-certs

Conversation

@ElleTojaroon

Copy link
Copy Markdown
Contributor

Description

az webapp config ssl list --resource-group <rg> (without --name) only enumerates classic resource-group-scoped certificates via certificates.list_by_resource_group. Certificates for Flex Consumption function apps are stored per-site as Microsoft.Web/sites/{app}/certificates and are only reachable through the site_certificates API, which list_ssl_certs queries solely when --name is supplied (and that argument is restricted to Flex apps). As a result a certificate that is imported and bound to a Flex Consumption function app does not appear in the resource-group-level listing at all, even though it exists and is in use.

This change makes the resource-group-level listing also enumerate the site-scoped certificates for any Flex Consumption function app in the resource group, so the output is complete.

Testing

Reproduced by importing a Key Vault certificate to a Flex Consumption (FC1) function app: az webapp config ssl list --resource-group <rg> returned an empty list while the certificate was present (Microsoft.Web/sites/{app}/certificates) and bound. With this change the certificate is listed.

Draft pending changelog and test additions.

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 17, 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 17, 2026

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

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 updates SSL certificate listing to include per-site certificates for Flex Consumption function apps so az webapp config ssl list returns a complete view within a resource group.

Changes:

  • Expands resource-group certificate listing to also enumerate web apps in the RG.
  • Detects Flex Consumption function apps and merges their site-level certificates into the result set.

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

Comment on lines +6853 to +6855
for app in client.web_apps.list_by_resource_group(resource_group_name):
if app.kind and 'functionapp' in app.kind and \n is_flex_functionapp(cmd.cli_ctx, resource_group_name, app.name):
certs.extend(client.site_certificates.list(resource_group_name=resource_group_name, name=app.name))
# Resource-group-level listing. Classic certificates are managed at the resource group level,
# but certificates for Flex Consumption function apps are stored per-site and are not returned
# by certificates.list_by_resource_group. Include those so the listing is complete.
certs = list(client.certificates.list_by_resource_group(resource_group_name))
for app in client.web_apps.list_by_resource_group(resource_group_name):
if app.kind and 'functionapp' in app.kind and \n is_flex_functionapp(cmd.cli_ctx, resource_group_name, app.name):
certs.extend(client.site_certificates.list(resource_group_name=resource_group_name, name=app.name))
return certs
# by certificates.list_by_resource_group. Include those so the listing is complete.
certs = list(client.certificates.list_by_resource_group(resource_group_name))
for app in client.web_apps.list_by_resource_group(resource_group_name):
if app.kind and 'functionapp' in app.kind and \n is_flex_functionapp(cmd.cli_ctx, resource_group_name, app.name):
@yonzhan

yonzhan commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

webapp

@ElleTojaroon

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Pushed a fix:

  • Switched the line continuation to parentheses (the backslash had been mangled into a literal , which was the syntax error breaking the build).
  • Made the kind check case-insensitive via app.kind.lower().

On the list() point: keeping the eager materialization is intentional here. ssl list renders the full set in one go, so the result isn't consumed as a lazy pager, and resource groups don't hold enough certificates for memory to be a concern.

@yonzhan yonzhan assigned yanzhudd and unassigned zhoxing-ms Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants