WebSiteManagementClient.web_apps.list_by_resource_group (and az webapp list) silently under-reports results on resource groups with 100+ App Services

オープン
#48,980 コメント 2 件 リアクション 1 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@msyyc がすでに取り組んでいます。

2026年9月17日 から。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
azure, python
領域
api, cloud

調査の方向性

まず、WebSiteManagementClient.web_apps.list_by_resource_group() と az webapp list で不一致を再現し、次に同じリソース グループに対する az resource list と件数を比較します。Microsoft.Web/sites の一覧取得とページングの動作を調査します。SDK と CLI の両方が、サイレントに切り詰めることなく、存在するすべての App Services を返せば完了です。

索引モデルが issue の本文から書いたものです。

説明

Mgmt

Package Name: azure-mgmt-web
Package Version: 11.0.0
Operating System: Windows 11
Python Version: 3.13

Describe the bug
WebSiteManagementClient.web_apps.list_by_resource_group() silently under-reports results on a resource group with 100+ App Services, returning only 32 of 101 existing resources with no error, exception, or indication that results were truncated. The Azure CLI command az webapp list (against the same resource group, same identity) exhibits the identical behavior, suggesting both share the same underlying listing logic. Azure Resource Graph and az resource list, queried against the same resource group, correctly return all 101.

To Reproduce
Steps to reproduce the behavior:

  1.   az resource list -g <resource-group> --resource-type Microsoft.Web/sites --query "length(@)"
    
  2.  az resource list -g <resource-group> --resource-type Microsoft.Web/sites --query "[].kind" -o tsv | sort | uniq -   c - returns all the resources count
    

Code which is not working:
from azure.identity import DefaultAzureCredential
from azure.mgmt.web import WebSiteManagementClient

credential = DefaultAzureCredential()
client = WebSiteManagementClient(credential, subscription_id="")
apps = list(client.web_apps.list_by_resource_group(""))
print(len(apps))

Expected behavior
list_by_resource_group() should return all App Services in the resource group, matching the count returned by Azure Resource Graph (Resources | where type =~ 'microsoft.web/sites' | where resourceGroup =~ 'bic-web-apps-rg') and az resource list --resource-type Microsoft.Web/sites, both of which correctly.

Additional context
Ruled out RBAC/permission scoping: same identity used for the CLI, the SDK, the Azure portal, and Resource Graph
Ruled out kind-based filtering (e.g. Function Apps or Logic Apps Standard being excluded from web-app-specific listings):
Workaround in use: querying Azure Resource Graph directly (bypassing list_by_resource_group entirely) returns the correct, complete count.
Suspected root cause: a pagination/continuation-token handling issue specific to the Microsoft.Web/sites list endpoint, shared by both the CLI and the Python SDK.
If this doesn't reproduce on a freshly created test resource group, it may be specific to something about our subscription or data rather than a universal SDK bug —
happy to open an Azure Support case and share the x-ms-correlation-request-id / x-ms-request-id from a failing call (visible via az webapp list --debug) so the request can be traced server-side without needing access to our environment.

主要言語
Python
スター
5.6k
フォーク
3.4k
平均マージ
1日 22時間
マージ済み PR(30日)
189

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Azure/azure-sdk-for-python のほかの issue

Azure/azure-sdk-for-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。