2

I have 2 Azure Functions - Powershell. One will Resume a PowerBI Embedded Capacity and the other will Pause it.

Then I have 1 Azure Function - C# that has to run once the PowerBI Embedded Capacity is running.

So in order to do that I will need an Orchestrator function that does the following:

  1. Await Powershell function until the PowerBI Embedded is running
  2. Await C# function to do some tasks
  3. Await Powershell function to Pause PowerBI Embedded

I was looking into this code but I guess this will work only when all your functions are C# and within the same Function App. Because I have C# and Powershell I have 2 Function Apps.

[FunctionName("E1_HelloSequence")]
public static async Task<List<string>> Run(
    [OrchestrationTrigger] IDurableOrchestrationContext context)
{
    var outputs = new List<string>();

    outputs.Add(await context.CallActivityAsync<string>("E1_SayHello", "Tokyo"));
    outputs.Add(await context.CallActivityAsync<string>("E1_SayHello", "Seattle"));
    outputs.Add(await context.CallActivityAsync<string>("E1_SayHello_DirectInput", "London"));

    // returns ["Hello Tokyo!", "Hello Seattle!", "Hello London!"]
    return outputs;
}

Any clue?

VAAA
  • 14,531
  • 28
  • 130
  • 253

2 Answers2

1

Durable PowerShell Functions are going to be in Public Preview soon, and you can try them out now by using these instructions. You can also watch the progress and leave your feedback here.

However, your orchestrator function and activity functions must reside the same Function app, but you cannot mix PowerShell and C# functions in the same app. I would suggest converting the C# function into PowerShell: perhaps you can rewrite this code in PowerShell, or wrap the C# code into a PowerShell module, or use the Add-Type cmdlet to inject C# code into PowerShell. Alternatively, convert your PowerShell functions into C# functions.

Anatoli Beliaev
  • 1,614
  • 11
  • 13
0

Durable Functions currently supports the following languages:

C#: both precompiled class libraries and C# script.
JavaScript: supported only for version 2.x of the Azure Functions runtime. Requires version 1.7.0 of the Durable Functions extension, or a later version.
F#: precompiled class libraries and F# script. F# script is only supported for version 1.x of the Azure Functions runtime.

It does not support function with powershell now. If you want this feature, you can give your voice to this feedback to prompt it to be achieved.

Joey Cai
  • 18,968
  • 1
  • 20
  • 30