flow run cancel
Cancels a specific flow run for the specified Microsoft Flow
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
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.
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?
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)

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.
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.
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?
Most helpful comment
Let me take a shot at this.