[Python] Azure python sdk resourcegraph no skip_token

Discussão em 'Python' iniciado por Stack, Maio 10, 2025.

  1. Stack

    Stack Membro Participativo

    no matter what i try skip_token is None. my code:

    from azure.identity import DefaultAzureCredential
    from azure.mgmt.resourcegraph import ResourceGraphClient
    from azure.mgmt.resourcegraph.models import QueryRequest, QueryRequestOptions
    import logging

    credential = DefaultAzureCredential()
    client = ResourceGraphClient(credential)

    query = """
    Resources
    | where type == "microsoft.network/networkinterfaces"
    | where isnotnull(managedBy)
    | mv-expand ipConfig = properties.ipConfigurations
    | where isnotnull(ipConfig.properties.privateLinkConnectionProperties.fqdns)
    | project fqdns = ipConfig.properties.privateLinkConnectionProperties.fqdns
    """

    fqdns = []
    skip_token = None

    while True:
    request = QueryRequest(
    query=query,
    options=QueryRequestOptions(
    skip_token=skip_token,
    top=1000,
    ),
    )
    response = client.resources(request)
    # do smth here

    skip_token = response.skip_token # always None


    sample response:


    {'additional_properties': {}, 'total_records': 10070, 'count': 1000, 'result_truncated': 'true', 'skip_token': None, 'data': [ xyz ], 'facets': [] }
    ​

    Continue reading...

Compartilhe esta Página