Cli-microsoft365: New command: flow run cancel

Created on 19 Oct 2020  路  10Comments  路  Source: pnp/cli-microsoft365

Usage

flow run cancel

Description

Cancels a specific flow run for the specified Microsoft Flow

Options

Option | Description
-- | --
-n, --name<name> | The name of the run to cancel
-f, --flow<flow> | The name of the Microsoft Flow to cancel
-e, --environment<environment>| The name of the environment where the Flow is located
--confirm| Don't prompt for confirmation

Additional Information

Use Fidler or Postman and disable a flow in the UI to see the exact post request. Will be a Post request tot the following url:

https://emea.api.flow.microsoft.com/providers/Microsoft.ProcessSimple/environments/{{environement}}/flows/{{flowid}}/runs/{{runid}}/cancel?api-version=2016-11-01.

good first issue new feature work in progress

Most helpful comment

Let me take a shot at this.

All 10 comments

If I look at the REST API call, it refers to run ID rather than run name. Should we rename -n, --name to -i, --runId?

Good point; I tried to be consistent with the flow run get: https://pnp.github.io/cli-microsoft365/cmd/flow/run/run-get/.

Gotcha! In that case, let's stay with the current spec 馃憤

Let me take a shot at this.

Awesome! Thanks for your help @Abderahman88 its all yours 馃憤馃徎

You can find our contribution guides in the wiki

Don't hesitate to reach out if you need any assistance.

No problem @garrytrinder. Happy to help.

After this one, I will do #1871

Does the runId has some kind of pattern to check if it's valid?

checkRunId

Something that I found that seems to me pretty odd.

1) Run ID exists and it's correct --> I get response 200 (what is expected - last part of Run ID = 4637979CU165)

runRight1

2) Run ID is completely wrong --> I get response 404 (what is expected - last part of Run ID = 4638009ZZ999)
The error says that the resource is not found.

runZZ999

3) Run ID is partially wrong --> I get response 200 (is odd - last part of Run ID = 4637979ZZ999)
I find this very strange, because the run does not exist in my environment.

runZZ999_1

It seems like the 5 last characters of the RUN ID are not taken into account to check if the run exists or not.
Any explanation for this?

I don't know how exactly the run ID is composed, so for now, I'd suggest we skip any validation of it.

Great investigation on the status codes @Abderahman88 from experience with working with this endpoint in the past, there are some status codes returned that you certainly would not expect. See https://github.com/pnp/cli-microsoft365/issues/1063#issuecomment-535977685 as an example.

We could query this with the Azure support and see what they suggest?

Was this page helpful?
0 / 5 - 0 ratings