Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LogicManagementClient.workflow_runs.list(RESOURCE_GROUP, LOGIC_APP_NAME, filter=filter_query) filter being appended during subsequent requests #39737

Open
lukebarkley opened this issue Feb 14, 2025 · 1 comment
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Logic App Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@lukebarkley
Copy link

lukebarkley commented Feb 14, 2025

  • azure.mgmt.logic:
  • 10.0.0.:
  • Win 10:
  • Python 3.12:

Describe the bug
The filter param is added on each subsequent request

To Reproduce

`

SUBSCRIPTION_ID = "SUBSCRIPTION_ID "
RESOURCE_GROUP = "RESOURCE_GROUP "
LOGIC_APP_NAME = "LOGIC_APP_NAME"

credential = DefaultAzureCredential()
logic_client = LogicManagementClient(credential, SUBSCRIPTION_ID)

START_DATE = "2025-01-01T00:00:00.000Z"
END_DATE = "2025-01-31T23:59:59.000Z"
filter_query = f"startTime ge {START_DATE} and startTime le {END_DATE}"

credential = DefaultAzureCredential()
logic_client = LogicManagementClient(credential, SUBSCRIPTION_ID)

print("Fetching filtered Logic App runs...")
filtered_runs = []

workflow_runs = logic_client.workflow_runs.list(
    RESOURCE_GROUP, LOGIC_APP_NAME, filter=filter_query, api_version="2016-10-01"
)

for run in workflow_runs:
    filtered_runs.append(run)

`

THIS WILL FAIL ON THE SECOND RUN

Expected behavior
The filter param is only applied once to the request.

The fix
azure.mgmt.logic.operations._workflow_runs_operations.py:170

`

170: def list(...)
...
...

202: def prepare_request(next_link=None):
            if not next_link:
                
            request = build_list_request(
                subscription_id=self._config.subscription_id,
                resource_group_name=resource_group_name,
                workflow_name=workflow_name,
                api_version=api_version,
                top=top,
                filter=filter,
                template_url=self.list.metadata['url'],
            )
            request = _convert_request(request)
            request.url = self._client.format_url(request.url)

        else:
            request = HttpRequest(
                method="GET",
                url=next_link
            )
        return request

`

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Feb 14, 2025
@kristapratico kristapratico added Logic App Mgmt This issue is related to a management-plane library. and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Feb 14, 2025
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Feb 14, 2025
@kristapratico
Copy link
Member

Thanks for your feedback @lukebarkley, we'll take a look as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Logic App Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants