cli-microsoft365 icon indicating copy to clipboard operation
cli-microsoft365 copied to clipboard

Bug report: m365 flow list --asAdmin does not return all flows

Open Lou-i3 opened this issue 1 year ago • 3 comments

Priority

(Medium) I'm annoyed but I'll live

Description

When using the command m365 flow list -e GUID --asAdmin with my environment GUID, I get only 5 flows. Some are the flows owned by the connected account, some not. The mentioned account is System Administrator of the environment.

Steps to reproduce

Run the command:

m365 flow list -e GUID --asAdmin

In an environment where you own only a few flows but where there are many others.

Expected results

Get the list of all flows in the environment.

Actual results

Only 5 flows. Some are the flows owned by the connected account, some not.

Diagnostics

Executing command flow list with options {"options":{"environmentName":"<GUID_Environment>","query":"[].{ Id: name, Name: displayName }","asAdmin":true,"debug":true,"output":"json"}} Executing command as '<AccountEmail>', appId: <AppId>, tenantId: <TenantId> Existing access token <AccessToken> still valid. Returning... Request: { "url": "https://api.flow.microsoft.com/providers/Microsoft.ProcessSimple/scopes/admin/environments/<GUID_Environment>/flows?api-version=2016-11-01", "method": "get", "headers": { "Accept": "application/json;odata.metadata=none", "user-agent": "NONISV|SharePointPnP|CLIMicrosoft365/7.6.0", "accept-encoding": "gzip, deflate", "X-ClientService-ClientTag": "M365CLI:7.6.0", "odata-version": "4.0", "authorization": "Bearer <AccessToken>" }, "responseType": "json", "decompress": true } Response: { "url": "https://api.flow.microsoft.com/providers/Microsoft.ProcessSimple/scopes/admin/environments/<GUID_Environment>/flows?api-version=2016-11-01", "status": 200, "statusText": "OK", "headers": { "content-length": "89848", "content-type": "application/json; charset=utf-8", "date": "Wed, 17 Apr 2024 14:08:49 GMT", "cache-control": "no-cache, no-store", "strict-transport-security": "max-age=31536000; includeSubDomains", "x-ms-islandgateway": "GA00000IN", "x-ms-request-id": "westeurope:<CorrelationRequestId>", "x-ms-correlation-request-id": "<CorrelationRequestId>", "x-ms-flow-mobile-ios-version": "3.0.421", "x-ms-flow-routing-request-id": "WESTEUROPE:20240417T140850Z:<CorrelationRequestId>", "server-timing": "x-ms-igw-upstream-headers;dur=850.2,x-ms-igw-req-overhead;dur=0.6", "x-content-type-options": "nosniff", "x-ms-service-request-id": "<ServiceRequestId>", "x-ms-correlation-id": "<CorrelationId>", "x-ms-activity-vector": "00" }, "data": { "value": [ { "name": "2247f6c6-d6d5-4277-9d67-29f2ada82386", "id": "/providers/Microsoft.ProcessSimple/environments/<GUID_Environment>/flows/2247f6c6-d6d5-4277-9d67-29f2ada82386", "type": "Microsoft.ProcessSimple/environments/flows", "properties": { "apiId": "/providers/Microsoft.PowerApps/apis/shared_logicflows", "displayName": "test", "userType": "Owner", "definition": { <FlowDefinition> }, "triggerSchema": { "type": "object", "properties": {}, "required": [] }, "state": "Started", "createdTime": "2023-12-02T09:35:10.3667219Z", "lastModifiedTime": "2023-12-04T08:56:56.6627265Z", "flowSuspensionReason": "None", "environment": { "name": "<GUID_Environment>", "type": "Microsoft.ProcessSimple/environments", "id": "/providers/Microsoft.ProcessSimple/environments/<GUID_Environment>" }, "definitionSummary": { <FlowDefinitionSummary> }, "creator": { "tenantId": "<TenantId>", "objectId": "<User1Id>", "userId": "<User1Id>", "userType": "ActiveDirectory" }, "provisioningMethod": "FromDefinition", "flowFailureAlertSubscribed": true, "isManaged": false, "machineDescriptionData": {} } }, { "name": "00245182-e943-f00c-b7a7-3774ef5a6653", "id": "/providers/Microsoft.ProcessSimple/environments/<GUID_Environment>/flows/00245182-e943-f00c-b7a7-3774ef5a6653", "type": "Microsoft.ProcessSimple/environments/flows", "properties": { "apiId": "/providers/Microsoft.PowerApps/apis/shared_logicflows", "displayName": "Copie de -Export Harmonie: Etablissement", "userType": "Owner", "definition": { <FlowDefinition> }, "state": "Stopped", "sharingType": "CommonDataService", "createdTime": "2023-12-02T08:20:07.6521193Z", "lastModifiedTime": "2024-04-17T07:57:36.9024768Z", "flowSuspensionReason": "None", "environment": { "name": "<GUID_Environment>", "type": "Microsoft.ProcessSimple/environments", "id": "/providers/Microsoft.ProcessSimple/environments/<GUID_Environment>" }, "definitionSummary": { <FlowDefinitionSummary> }, "creator": { "tenantId": "<TenantId>", "objectId": "<User1Id>", "userId": "<User1Id>", "userType": "ActiveDirectory" }, "provisioningMethod": "FromDefinition", "flowFailureAlertSubscribed": true, "workflowEntityId": "ee6de076-eb90-ee11-be37-000d3ad8da0b", "isManaged": false, "machineDescriptionData": {} } }, { "name": "8e22498e-5fe2-733d-971f-32d5acaa1b9c", "id": "/providers/Microsoft.ProcessSimple/environments/<GUID_Environment>/flows/8e22498e-5fe2-733d-971f-32d5acaa1b9c", "type": "Microsoft.ProcessSimple/environments/flows", "properties": { "apiId": "/providers/Microsoft.PowerApps/apis/shared_logicflows", "displayName": "Heritage_Groupe_Désactivation", "userType": "Owner", "definition": { <FlowDefinition> }, "state": "Started", "sharingType": "CommonDataService", "createdTime": "2023-11-24T17:14:08.3373101Z", "lastModifiedTime": "2024-04-17T08:01:22.400857Z", "flowSuspensionReason": "None", "environment": { "name": "<GUID_Environment>", "type": "Microsoft.ProcessSimple/environments", "id": "/providers/Microsoft.ProcessSimple/environments/<GUID_Environment>" }, "definitionSummary": { <FlowDefinitionSummary> }, "creator": { "tenantId": "<TenantId>", "objectId": "<User1Id>", "userId": "<User1Id>", "userType": "ActiveDirectory" }, "provisioningMethod": "FromDefinition", "flowFailureAlertSubscribed": true, "workflowEntityId": "7893960c-038a-ee11-8179-6045bd8861b1", "isManaged": false, "machineDescriptionData": {} } }, { "name": "9957b1e6-d002-87b6-48db-f379396e4dc1", "id": "/providers/Microsoft.ProcessSimple/environments/<GUID_Environment>/flows/9957b1e6-d002-87b6-48db-f379396e4dc1", "type": "Microsoft.ProcessSimple/environments/flows", "properties": { "apiId": "/providers/Microsoft.PowerApps/apis/shared_logicflows", "displayName": "Export_Groupes", "userType": "Owner", "definition": { <FlowDefinition> }, "triggerSchema": { "type": "object", "properties": { "text": { "title": "ExportGroupeJSON", "type": "string", "x-ms-dynamically-added": true, "description": "Tapez votre entrée", "x-ms-content-hint": "TEXT" }, "text_1": { "title": "Nom_Utilisateur", "type": "string", "x-ms-dynamically-added": true, "description": "Tapez votre entrée", "x-ms-content-hint": "TEXT" }, "text_2": { "title": "AAD_ID_Utilisateur", "type": "string", "x-ms-dynamically-added": true, "description": "Tapez votre entrée", "x-ms-content-hint": "TEXT" } }, "required": [ "text", "text_1", "text_2" ] }, "state": "Started", "sharingType": "CommonDataService", "createdTime": "2023-10-20T15:13:46.6780847Z", "lastModifiedTime": "2024-04-17T08:00:12.2637943Z", "flowSuspensionReason": "None", "environment": { "name": "<GUID_Environment>", "type": "Microsoft.ProcessSimple/environments", "id": "/providers/Microsoft.ProcessSimple/environments/<GUID_Environment>" }, "definitionSummary": { <FlowDefinitionSummary> }, "creator": { "tenantId": "<TenantId>", "objectId": "<User1Id>", "userId": "<User1Id>", "userType": "ActiveDirectory" }, "provisioningMethod": "FromDefinition", "flowFailureAlertSubscribed": true, "workflowEntityId": "ce60a75f-d056-ee11-be6e-6045bd886bc5", "isManaged": false, "machineDescriptionData": {} } }, { "name": "ae6167f5-e365-e82c-047c-f1a3ce899b17", "id": "/providers/Microsoft.ProcessSimple/environments/<GUID_Environment>/flows/ae6167f5-e365-e82c-047c-f1a3ce899b17", "type": "Microsoft.ProcessSimple/environments/flows", "properties": { "apiId": "/providers/Microsoft.PowerApps/apis/shared_logicflows", "displayName": "Export Harmonie: Etablissement", "userType": "Owner", "definition": { <FlowDefinition> }, "state": "Started", "sharingType": "CommonDataService", "createdTime": "2023-04-13T13:20:06.0581187Z", "lastModifiedTime": "2024-04-17T08:01:03.5983528Z", "flowSuspensionReason": "None", "environment": { "name": "<GUID_Environment>", "type": "Microsoft.ProcessSimple/environments", "id": "/providers/Microsoft.ProcessSimple/environments/<GUID_Environment>" }, "definitionSummary": { <FlowDefinitionSummary> }, "creator": { "tenantId": "<TenantId>", "objectId": "<User1Id>", "userId": "<User1Id>", "userType": "ActiveDirectory" }, "provisioningMethod": "FromDefinition", "flowFailureAlertSubscribed": true, "workflowEntityId": "0ca256da-7466-ed11-9561-6045bd8861b1", "isManaged": false, "machineDescriptionData": {} } } ] } } DONE

Timings: api: 1261.765416ms core: 8.891625ms command: 1271.874667ms options: 0.05375ms total: 1283.617083ms validation: 0.190458ms

CLI for Microsoft 365 version

v7.6.0

nodejs version

v20.5.0

Operating system (environment)

macOS

Shell

PowerShell

cli doctor

{ "os": { "platform": "darwin", "version": "Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000", "release": "23.4.0" }, "cliVersion": "7.6.0", "nodeVersion": "v20.5.0", "cliAadAppId": "31359c7f-bd7e-475c-86db-fdb8c937548e", "cliAadAppTenant": "organizations", "authMode": "Password", "cliEnvironment": "", "cliConfig": {}, "roles": [], "scopes": { "https://graph.microsoft.com": [ "AllSites.FullControl", "AppCatalog.ReadWrite.All", "ChannelMember.ReadWrite.All", "ChannelMessage.Send", "ChannelSettings.ReadWrite.All", "Directory.AccessAsUser.All", "Directory.ReadWrite.All", "Group.ReadWrite.All", "IdentityProvider.ReadWrite.All", "Mail.ReadWrite", "Mail.Send", "Policy.Read.All", "Reports.Read.All", "Tasks.ReadWrite", "Team.Create", "TeamMember.ReadWrite.All", "TeamsApp.ReadWrite.All", "TeamsAppInstallation.ReadWriteForUser", "TeamSettings.ReadWrite.All", "TeamsTab.ReadWrite.All", "TermStore.ReadWrite.All", "User.Invite.All", "User.ReadWrite.All", "profile", "openid", "email" ], "https://management.azure.com/": [ "user_impersonation" ] } }

Additional Info

Using the command without the --asAdmin flag works as expected.

Lou-i3 avatar Apr 17 '24 14:04 Lou-i3

Hi @Lou-i3 thank you for reporting this issue. How many flows do you see when you visit the Power Platform admin center? https://admin.powerplatform.microsoft.com/environments/<env ID>/flows

milanholemans avatar Apr 17 '24 16:04 milanholemans

On this url there are a lot more flows listed there. Some owned by the concerned user and other from other users.

Lou-i3 avatar Apr 17 '24 17:04 Lou-i3

It's very odd that you see more flows in the UI. The browser makes exactly the same request as we do, the only difference is that the browser is targeting a beta version of the API and we don't, but that shouldn't make much difference in my opinion.

At least for me, I'm getting exactly the same results both in UI and CLI.

milanholemans avatar Apr 17 '24 20:04 milanholemans