Skip to content

Add help for all Durable Functions cmdlets #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,35 @@ Get-ChildItem -Path (Join-Path "$shimPath" "$publishPathSuffix") |
Write-Log "Copying PowerShell module and manifest from the Durable SDK source code into $outputPath" "Gray"
Copy-Item -Path $powerShellModulePath -Destination $outputPath
Copy-Item -Path $manifestPath -Destination $outputPath

#region GENERATE EXTERNAL HELP ===================================================================
Write-Log "Generating external help files (MAML) from markdown documentation..." "Gray"

# Install PlatyPS module if not already available
if (-not (Get-Module -ListAvailable -Name PlatyPS)) {
Write-Log "Installing PlatyPS module..." "Cyan"
Install-Module -Name PlatyPS -Force -Scope CurrentUser
}

# Import PlatyPS module
Import-Module PlatyPS -Force

# Define paths for help generation
$docsPath = "$PSScriptRoot/src/Help"
$helpPath = "$outputPath/en-US"

# Create the help directory if it doesn't exist
if (-not (Test-Path $helpPath)) {
Write-Log "Creating help directory at $helpPath" "Cyan"
New-Item -Path $helpPath -ItemType Directory -Force
}

# Generate external help files from markdown
Write-Log "Converting markdown files to MAML help files..." "Gray"
New-ExternalHelp -Path $docsPath -OutputPath $helpPath -Force
Write-Log "External help files generated successfully in $helpPath" "Green"
#endregion

Write-Log "Build succeeded!"
#endregion

Expand Down
34 changes: 0 additions & 34 deletions src/AzureFunctions.PowerShell.Durable.SDK.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,6 @@ function Get-DurableStatus {
Invoke-RestMethod -Uri $requestUrl
}

<#
.SYNOPSIS
Start an orchestration Azure Function.
.DESCRIPTION
Start an orchestration Azure Function with the given function name and input value.
.EXAMPLE
PS > Start-DurableOrchestration -DurableClient Starter -FunctionName OrchestratorFunction -InputObject "input value for the orchestration function"
Return the instance id of the new orchestration.
.PARAMETER FunctionName
The name of the orchestration Azure Function you want to start.
.PARAMETER InputObject
The input value that will be passed to the orchestration Azure Function.
.PARAMETER DurableClient
The orchestration client object.
#>
function Start-DurableOrchestration {
[CmdletBinding()]
param(
Expand Down Expand Up @@ -284,25 +269,6 @@ function New-DurableOrchestrationCheckStatusResponse {
}
}

<#
.SYNOPSIS
Send an external event to an orchestration instance.
.DESCRIPTION
Send an external event with the given event name, and event data to an orchestration instance with the given instance ID.
.EXAMPLE
PS > Send-DurableExternalEvent -InstanceId "example-instance-id" -EventName "ExampleExternalEvent" -EventData "data for the external event"
Return the instance id of the new orchestration.
.PARAMETER InstanceId
The ID of the orchestration instance that will handle the external event.
.PARAMETER EventName
The name of the external event.
.PARAMETER EventData
The JSON-serializable data associated with the external event.
.PARAMETER TaskHubName
The TaskHubName of the orchestration instance that will handle the external event.
.PARAMETER ConnectionName
The name of the connection string associated with TaskHubName
#>
function Send-DurableExternalEvent {
[CmdletBinding()]
param(
Expand Down
83 changes: 83 additions & 0 deletions src/Help/AzureFunctions.PowerShell.Durable.SDK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
Module Name: AzureFunctions.PowerShell.Durable.SDK
Module Guid: 841fad61-94f5-4330-89be-613d54165289
Download Help Link: https://github.com/Azure/azure-functions-durable-powershell
Help Version: 1.0.0.0
Locale: en-US
---

# AzureFunctions.PowerShell.Durable.SDK Module

## Description

The AzureFunctions.PowerShell.Durable.SDK module provides cmdlets for building durable, stateful functions in Azure Functions using PowerShell. This SDK enables you to create orchestrator functions, activity functions, and manage durable orchestration workflows with features like timers, external events, and sub-orchestrations.

## AzureFunctions.PowerShell.Durable.SDK Cmdlets

### [Get-DurableStatus](Get-DurableStatus.md)

Gets the status of a durable orchestration instance, including execution history, input data, and output data.

### [Get-DurableTaskResult](Get-DurableTaskResult.md)

Gets the result of a completed durable task, such as an activity function or sub-orchestrator.

### [Invoke-DurableActivity](Invoke-DurableActivity.md)

Invokes an activity function from within an orchestrator function.

### [Invoke-DurableSubOrchestrator](Invoke-DurableSubOrchestrator.md)

Invokes a sub-orchestrator function from within a parent orchestrator function.

### [New-DurableOrchestrationCheckStatusResponse](New-DurableOrchestrationCheckStatusResponse.md)

Creates an HTTP response for orchestration status check endpoints with status polling URLs.

### [New-DurableRetryPolicy](New-DurableRetryPolicy.md)

Creates a retry policy for durable activity functions and sub-orchestrators.

### [Resume-DurableOrchestration](Resume-DurableOrchestration.md)

Resumes a suspended durable orchestration instance.

### [Send-DurableExternalEvent](Send-DurableExternalEvent.md)

Sends an external event to a running durable orchestration instance.

### [Set-DurableCustomStatus](Set-DurableCustomStatus.md)

Sets custom status information for a durable orchestration instance.

### [Set-FunctionInvocationContext](Set-FunctionInvocationContext.md)

Sets the function invocation context for durable function operations.

### [Start-DurableExternalEventListener](Start-DurableExternalEventListener.md)

Starts listening for an external event within an orchestrator function.

### [Start-DurableOrchestration](Start-DurableOrchestration.md)

Starts a new durable orchestration instance with the specified function name and input.

### [Start-DurableTimer](Start-DurableTimer.md)

Starts a durable timer that fires after a specified delay or at a specific time.

### [Stop-DurableOrchestration](Stop-DurableOrchestration.md)

Terminates a running durable orchestration instance.

### [Stop-DurableTimerTask](Stop-DurableTimerTask.md)

Stops a running durable timer task.

### [Suspend-DurableOrchestration](Suspend-DurableOrchestration.md)

Suspends a running durable orchestration instance.

### [Wait-DurableTask](Wait-DurableTask.md)

Waits for the completion of one or more durable tasks within an orchestrator function.
161 changes: 161 additions & 0 deletions src/Help/Get-DurableStatus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
---
external help file: AzureFunctions.PowerShell.Durable.SDK-help.xml
Module Name: AzureFunctions.PowerShell.Durable.SDK
online version:
schema: 2.0.0
---

# Get-DurableStatus

## SYNOPSIS

Get the status of a durable orchestration instance.

## SYNTAX

```
Get-DurableStatus [-InstanceId] <String> [-DurableClient <Object>] [-ShowHistory] [-ShowHistoryOutput] [-ShowInput] [<CommonParameters>]
```

## DESCRIPTION

Get the status of a durable orchestration instance with the given instance ID.
Optionally includes execution history, history output, and input data.

## EXAMPLES

### Example 1

```powershell
Get-DurableStatus -InstanceId "example-instance-id"
```

Returns the basic status of the orchestration instance.

### Example 2

```powershell
Get-DurableStatus -InstanceId "example-instance-id" -ShowHistory -ShowHistoryOutput
```

Returns the status with detailed execution history and output.

## PARAMETERS

### -InstanceId

The ID of the orchestration instance to get the status for.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -DurableClient

The durable client object.
If not provided, it will be retrieved from module private data.

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -ShowHistory

When present, includes the execution history in the response.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -ShowHistoryOutput

When present, includes the output of each step in the execution history.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -ShowInput

When present, includes the input data that was provided to the orchestration instance.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### System.String

You can pipe instance ID strings to this cmdlet to get the status of multiple orchestration instances.

## OUTPUTS

### System.Object

Returns a status object containing information about the durable orchestration instance, including:

- InstanceId: The unique identifier of the orchestration instance
- RuntimeStatus: The current runtime status (Running, Completed, Failed, etc.)
- Input: The input data provided to the orchestration (if -ShowInput is specified)
- Output: The output of the orchestration (if completed)
- CreatedTime: When the orchestration was created
- LastUpdatedTime: When the orchestration was last updated
- History: Execution history (if -ShowHistory is specified)

## NOTES

- This cmdlet is typically used in HTTP trigger functions or other client functions to check orchestration progress.
- The InstanceId must be from an existing orchestration; invalid IDs will result in a null response.
- Use -ShowHistory to get detailed execution steps, which is useful for debugging orchestration behavior.
- The -ShowHistoryOutput parameter can produce large responses; use carefully in production environments.
- Status information includes runtime state, input/output data, creation time, and last update time.
- Orchestration status is eventually consistent and may take a moment to reflect the latest state after operations.

## RELATED LINKS

[Durable Functions for PowerShell](https://github.com/Azure/azure-functions-durable-powershell)
Loading