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

Aberta
#48,980 2 comentários 1 reação 1 responsável Ver no GitHub

Mantenedores costumam responder em até 1 dia

@msyyc já está trabalhando nisso.

Desde 17/9/2026.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
45/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
azure, python
Domínio
api, cloud

Direção de pesquisa

Comece reproduzindo a discrepância com WebSiteManagementClient.web_apps.list_by_resource_group() e az webapp list e, em seguida, compare as contagens com az resource list para o mesmo grupo de recursos. Investigue o comportamento de listagem e paginação de Microsoft.Web/sites; considera-se concluído quando tanto o SDK quanto a CLI retornarem todos os App Services existentes sem truncamento silencioso.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Python
Estrelas
5.6k
Forks
3.4k
Merge médio
1d 22h
PRs com merge (30d)
189

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de Azure/azure-sdk-for-python

Todas as issues de Azure/azure-sdk-for-python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.