Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (22 sloc) 1.03 KB

Demo application to show waiting for multiple approvals in Durable Functions with timeout.

Submit an approval request

$approvalRequest = "{ approverCount: 5, requiredApprovals: 3, timeoutMinutes: 2 }"
$starterUri = "http://localhost:7071/api/RequestApproval"
$statusUris = Invoke-RestMethod -Method Post -Body $approvalRequest -Uri $starterUri

Request approval status

Invoke-RestMethod -Method Get -Uri $statusUris.statusQueryGetUri

Submit Approval

$submitUri = "http://localhost:7071/api/SubmitApproval/$($statusUris.id)"
Invoke-RestMethod -Method Post -Uri $submitUri -Body '{ approved: true, approver: "approver 1" }'

Flows to test:

  • Timeout
  • Approved
  • Same approver submits more than one (their vote should only be counted once)
  • Race condition (we should not miss any votes) - should be fixed in v1.8.0
  • Approval rejected (also allows same user to send a reject after initally approving)
You can’t perform that action at this time.