microsoft / coe-starter-kit

Other
747 stars 219 forks source link

[CoE Starter Kit - Feature]: Flow Trigger status #7421

Open jackpoz opened 9 months ago

jackpoz commented 9 months ago

Is your feature request related to a problem? Please describe.

When a trigger connection is no longer valid (for example due to an expired password), the flow shows a message "There's a problem with the flow's trigger": image

When having hundreds of flows, one cannot check each flow manually.

Describe the solution you'd like

Power Platform Admin View could show the trigger status as one of the fields (maybe it does already but I couldn't find it).

Describe alternatives you've considered

No response

Additional context?

I don't have the "sync flow action details" currently enabled, not sure if that would already give the same result. I also understand that any feature requested to CoE Kit is bound to Power Platform product limitations and APIs availability.

AB#1995

Jenefer-Monroe commented 9 months ago

We do not capture this today, no. I dont have any such repros in my tenant. Can you please take a look at one of these flows to see if this is exposed?

If you call Get Flow as Admin with one of your examples, see if it returns anything about the trigger state or the flow state that indicates this. image

jackpoz commented 8 months ago

Hi Jenefer, as a repro case this happens when the "Failed checks" in the "Run history" has entries and the trigger is not successful for a few days: image

In my particular case it's a SharePoint Online trigger with an account that has been deleted from Entra ID after the flow was set up.

I wasn't fast enough to run the steps that you asked and one of my team colleagues already fixed the issue, so the message disappeared. I will set up a new test case and wait for the message to appear again. It might take a while but I will come back with the result, I promise :)

jackpoz commented 8 months ago

I was able to reproduce this in a easier way by create a flow with "SharePoint > When an item is created or modified", trigger the flow a few times by adding some list items on SharePoint, then removing permissions from the user on that SPO list: image

image

The triggers section doesn't mention anything about the failures:

"triggers": {
  "When_an_item_is_created_or_modified": {
      "recurrence": {
          "frequency": "Minute",
          "interval": 5
      },
      "splitOn": "@triggerOutputs()?['body/value']",
      "metadata": {
          "operationMetadataId": "0fedcb8f-9fdf-4042-8f20-9d3762fb7ccd"
      },
      "type": "OpenApiConnection",
      "inputs": {
          "host": {
              "apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline",
              "connectionName": "shared_sharepointonline",
              "operationId": "GetOnUpdatedItems"
          },
          "parameters": {
              "dataset": "https://gpsgit.sharepoint.com/sites/TestCommunicationSite",
              "table": "38ea552e-4d01-4108-a288-57801a4840ef"
          },
          "authentication": "@parameters('$authentication')"
      }
  }
},

The Flow State is "Started" image

So it doesn't seem like any information is returned by this API about the trigger failing.

jackpoz commented 8 months ago

Checking the calls done on the page, I found https://api.flow.microsoft.com/providers/Microsoft.ProcessSimple/environments/Default-6b3a9de4-0329-4d0c-9fcf-efe10517e929/flows/aee92bd7-cf07-4a1a-93a2-5cd83d4b5cd0/diagnostics?api-version=2016-11-01&$filter=Trigger,Flow,ConnectionMode,Licensing,LegacyCDSConnector that returns the response below:

[
    {
        "name": "Trigger",
        "level": "Error",
        "diagnosticCode": "FailingTrigger",
        "metadata": {
            "lastFailedCheckId": "08584966220539794986951980873CU154",
            "lastSuccessfulCheckId": "08584966240365550595007418620CU253",
            "lastSuccessfulRunDate": "14:20 01/11/24",
            "iconUri": "https://connectoricons-prod.azureedge.net/releases/v1.0.1670/1.0.1670.3526/sharepointonline/icon.png"
        }
    }
]

The API seems to follow the format https://api.flow.microsoft.com/providers/Microsoft.ProcessSimple/environments/<environment id>/flows/<flow id>/diagnostics

The same endpoint on a "working" flow returns an empty array:

[]
Jenefer-Monroe commented 8 months ago

Thanks for this information! I'm asking around to see if there is a way to track this that wouldnt require we check each flow since that's too api intensive for the kit.

Jenefer-Monroe commented 8 months ago

Marking as a product gap so we can track the ask.