0

I have below code For Orchestrator Function run.ps1

param($Context)
$output = @()
$input="test"
$output1 = Invoke-DurableActivity -FunctionName 'storage_account' -Input $input -nowait
Wait-ActivityFunction -Task $output1
$output1

function.json

{
  "bindings": [
    {
      "name": "Context",
      "type": "orchestrationTrigger",
      "direction": "in"
    }
  ]
}

Activity Trigger -- storage_account function.json

 {
      "bindings": [
        {
          "name": "name",
          "type": "activityTrigger",
          "direction": "in"
        }
      ]
    }

run.ps1

param($name)
$rg="test"
$location="westus"
$checkname = (Get-AzStorageAccountNameAvailability $name).NameAvailable

If($checkname -eq "False"){
$name= $name + "date"+(get-date -Format MMdd)+"time"+(get-date -Format hhmm)
}
 "Storage Account $name :inprogress"
$accountstatus = New-AzStorageAccount -Name $name -ResourceGroupName $rg -SkuName Standard_LRS -Location $location 
IF(($accountstatus.ProvisioningState) -eq 'Succeeded'){
    "Storage Account $name :Created"
}

Is there any ways to get durable Functions activity status inside the statusQueryGetUri or inside the Orchestrator ? Currently result will be getting after all completed but I need the result for every activity like creating or created. I can set single status using

Update: I can get single status using (docs:https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-custom-orchestration-status?tabs=powershell#querying-custom-status-with-http Set-DurableCustomStatus) there is only single status can be store , If I use customstatus 2 times then 2nd one (or last one show on output) will be show in output & 1st one will be disappear. but I'm looking for the status like

{
  "customStatus": ["Completed", "Completed", "Started", "Started", "Completed"]
}

docs:https://joonasw.net/view/track-activity-and-sub-orchestrator-progress-in-azure-durable-functions-orchestrators

multiple status achieved by C# but I cannot see any docs for multiple custom status cannot be set by powershell.

microset
  • 276
  • 1
  • 2
  • 12
  • Not sure about ps but in C# I know the status of the orchestrator by setting a custom status before each function app call using IDurableOrchestrationContext.SetCustomStatus("some status") then serving it in another function with an HttpTrigger using IDurableOrchestrationClient.GetStatusAsync() – codebrane Nov 23 '22 at 12:02
  • I'm not familiar with Azure Functions, but if I understand you correctly, you want to _iteratively add to_ custom status information already associated with a function. Assuming there are no concurrency issues, couldn't you first _get_ the current info, modify it, and then re-upload? – mklement0 Nov 24 '22 at 15:04

1 Answers1

0

how to get azure durable Functions activity status inside the Orchestrator function?

Is there any ways to get durable Functions activity status inside the statusQueryGetUri or inside the Orchestrator?

statusQueryGetUri requires the Http Endpoint of the Functions activity class which also requires the system key as admin endpoint. Because status endpoint URL contains the same value as the statusQueryGetUri field.

Even the custom status can be set using PowerShell code to durable activity functions, the status can be queried using the HTTP GET API Request.

Refer to Marc’s Answer on getting the activity function status using the Http Endpoints and also Azure Functions Core Tools Cmdlet.

Delliganesh Sevanesan
  • 4,146
  • 1
  • 5
  • 15
  • @sevanesan, you're right we can set custom status as per docs (https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-custom-orchestration-status?tabs=powershell#querying-custom-status-with-http) but there is only single status can be store , If I use customstatus 2 times then 2nd one will be show in output. you can see the docs (https://joonasw.net/view/track-activity-and-sub-orchestrator-progress-in-azure-durable-functions-orchestrators) that have multiple "customStatus": ["Completed", "Completed", "Started", "Started", "Completed"] found, I'm exactly looking for. – microset Nov 24 '22 at 11:35