Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6723dde
Add remote activity SDK APIs
YunchuWang May 14, 2026
05223b6
Add remote activity worker profiles
YunchuWang May 14, 2026
ce8c38c
serverless pkg
YunchuWang May 15, 2026
8d96663
remove launchcommand
YunchuWang May 15, 2026
6dc7d23
separate declare from conneect
YunchuWang May 15, 2026
a94c91c
logcleanup
YunchuWang May 15, 2026
a1a03d8
use grpc retry
YunchuWang May 15, 2026
f58cd4d
inflight activity tracker
YunchuWang May 15, 2026
48f7284
serverless connection resilient
YunchuWang May 15, 2026
7c94c39
completeasync
YunchuWang May 15, 2026
cfa428e
add jitter
YunchuWang May 15, 2026
11a7914
dup headers
YunchuWang May 18, 2026
821069a
make taskhub metadata opt-out
YunchuWang May 20, 2026
1077961
Add serverless sandbox list and log APIs
YunchuWang May 20, 2026
e1433f2
remove declarat
YunchuWang May 20, 2026
4891155
Add serverless activities sample
YunchuWang May 20, 2026
42b6153
Remove serverless sample no-auth credential
YunchuWang May 20, 2026
71c9359
Simplify serverless sample auth and HTTP helper
YunchuWang May 20, 2026
55c9e36
Remove insecure credential sample wiring
YunchuWang May 20, 2026
560557c
simple serverless sample
YunchuWang May 21, 2026
2ca9681
Simplify serverless sample dashboard flow
YunchuWang May 21, 2026
dfede69
cleanup
YunchuWang May 21, 2026
81a603c
sync proto
YunchuWang May 21, 2026
18c8e02
remove env var
YunchuWang May 21, 2026
d5dcc19
Revert "remove env var"
YunchuWang May 22, 2026
408ee71
Enhance serverless worker registration and configuration
YunchuWang May 22, 2026
008a416
Remove serverless wakeup listener
YunchuWang May 22, 2026
a60e43a
Split serverless worker runtime options
YunchuWang May 22, 2026
ee477ac
Refactor serverless options and improve activity registration methods
YunchuWang May 22, 2026
098983a
remove public pull
YunchuWang May 22, 2026
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
79 changes: 76 additions & 3 deletions Microsoft.DurableTask.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32901.215
Expand Down Expand Up @@ -115,6 +115,24 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NamespaceGenerationSample",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReplaySafeLoggerFactorySample", "samples\ReplaySafeLoggerFactorySample\ReplaySafeLoggerFactorySample.csproj", "{8E7BECBC-7226-4778-B8F2-8EBDFF0D3BA4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{21303FBF-2A2B-17C2-D2DF-3E924022E940}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzureManagedServerless", "src\Extensions\AzureManagedServerless\AzureManagedServerless.csproj", "{C6DC28DC-95CE-42DA-B02C-FFB2BA1CB1A2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AzureManaged", "AzureManaged", "{D4587EC0-1B16-8420-7502-A967139249D4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AzureManaged", "AzureManaged", "{53193780-CD18-2643-6953-C26F59EAEDF5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{00205C88-F000-28F2-A910-C6FA00E065EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzureManagedServerless.Tests", "test\Extensions\AzureManagedServerless.Tests\AzureManagedServerless.Tests.csproj", "{4D50F5B2-4782-486F-A9AA-073D798CC60D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "serverless", "serverless", "{5BD6F026-413E-9AC5-D159-8E8D9F26EF1B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "main-app", "samples\serverless\main-app\main-app.csproj", "{4535F88F-EA1C-4C6F-84D5-93535EE1568C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "remote-worker", "samples\serverless\remote-worker\remote-worker.csproj", "{562E5DB9-761B-4DE9-98CB-C364F6DE558E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -701,7 +719,54 @@ Global
{8E7BECBC-7226-4778-B8F2-8EBDFF0D3BA4}.Release|x64.Build.0 = Release|Any CPU
{8E7BECBC-7226-4778-B8F2-8EBDFF0D3BA4}.Release|x86.ActiveCfg = Release|Any CPU
{8E7BECBC-7226-4778-B8F2-8EBDFF0D3BA4}.Release|x86.Build.0 = Release|Any CPU

{C6DC28DC-95CE-42DA-B02C-FFB2BA1CB1A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C6DC28DC-95CE-42DA-B02C-FFB2BA1CB1A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C6DC28DC-95CE-42DA-B02C-FFB2BA1CB1A2}.Debug|x64.ActiveCfg = Debug|Any CPU
{C6DC28DC-95CE-42DA-B02C-FFB2BA1CB1A2}.Debug|x64.Build.0 = Debug|Any CPU
{C6DC28DC-95CE-42DA-B02C-FFB2BA1CB1A2}.Debug|x86.ActiveCfg = Debug|Any CPU
{C6DC28DC-95CE-42DA-B02C-FFB2BA1CB1A2}.Debug|x86.Build.0 = Debug|Any CPU
{C6DC28DC-95CE-42DA-B02C-FFB2BA1CB1A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C6DC28DC-95CE-42DA-B02C-FFB2BA1CB1A2}.Release|Any CPU.Build.0 = Release|Any CPU
{C6DC28DC-95CE-42DA-B02C-FFB2BA1CB1A2}.Release|x64.ActiveCfg = Release|Any CPU
{C6DC28DC-95CE-42DA-B02C-FFB2BA1CB1A2}.Release|x64.Build.0 = Release|Any CPU
{C6DC28DC-95CE-42DA-B02C-FFB2BA1CB1A2}.Release|x86.ActiveCfg = Release|Any CPU
{C6DC28DC-95CE-42DA-B02C-FFB2BA1CB1A2}.Release|x86.Build.0 = Release|Any CPU
{4D50F5B2-4782-486F-A9AA-073D798CC60D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D50F5B2-4782-486F-A9AA-073D798CC60D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D50F5B2-4782-486F-A9AA-073D798CC60D}.Debug|x64.ActiveCfg = Debug|Any CPU
{4D50F5B2-4782-486F-A9AA-073D798CC60D}.Debug|x64.Build.0 = Debug|Any CPU
{4D50F5B2-4782-486F-A9AA-073D798CC60D}.Debug|x86.ActiveCfg = Debug|Any CPU
{4D50F5B2-4782-486F-A9AA-073D798CC60D}.Debug|x86.Build.0 = Debug|Any CPU
{4D50F5B2-4782-486F-A9AA-073D798CC60D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D50F5B2-4782-486F-A9AA-073D798CC60D}.Release|Any CPU.Build.0 = Release|Any CPU
{4D50F5B2-4782-486F-A9AA-073D798CC60D}.Release|x64.ActiveCfg = Release|Any CPU
{4D50F5B2-4782-486F-A9AA-073D798CC60D}.Release|x64.Build.0 = Release|Any CPU
{4D50F5B2-4782-486F-A9AA-073D798CC60D}.Release|x86.ActiveCfg = Release|Any CPU
{4D50F5B2-4782-486F-A9AA-073D798CC60D}.Release|x86.Build.0 = Release|Any CPU
{4535F88F-EA1C-4C6F-84D5-93535EE1568C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4535F88F-EA1C-4C6F-84D5-93535EE1568C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4535F88F-EA1C-4C6F-84D5-93535EE1568C}.Debug|x64.ActiveCfg = Debug|Any CPU
{4535F88F-EA1C-4C6F-84D5-93535EE1568C}.Debug|x64.Build.0 = Debug|Any CPU
{4535F88F-EA1C-4C6F-84D5-93535EE1568C}.Debug|x86.ActiveCfg = Debug|Any CPU
{4535F88F-EA1C-4C6F-84D5-93535EE1568C}.Debug|x86.Build.0 = Debug|Any CPU
{4535F88F-EA1C-4C6F-84D5-93535EE1568C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4535F88F-EA1C-4C6F-84D5-93535EE1568C}.Release|Any CPU.Build.0 = Release|Any CPU
{4535F88F-EA1C-4C6F-84D5-93535EE1568C}.Release|x64.ActiveCfg = Release|Any CPU
{4535F88F-EA1C-4C6F-84D5-93535EE1568C}.Release|x64.Build.0 = Release|Any CPU
{4535F88F-EA1C-4C6F-84D5-93535EE1568C}.Release|x86.ActiveCfg = Release|Any CPU
{4535F88F-EA1C-4C6F-84D5-93535EE1568C}.Release|x86.Build.0 = Release|Any CPU
{562E5DB9-761B-4DE9-98CB-C364F6DE558E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{562E5DB9-761B-4DE9-98CB-C364F6DE558E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{562E5DB9-761B-4DE9-98CB-C364F6DE558E}.Debug|x64.ActiveCfg = Debug|Any CPU
{562E5DB9-761B-4DE9-98CB-C364F6DE558E}.Debug|x64.Build.0 = Debug|Any CPU
{562E5DB9-761B-4DE9-98CB-C364F6DE558E}.Debug|x86.ActiveCfg = Debug|Any CPU
{562E5DB9-761B-4DE9-98CB-C364F6DE558E}.Debug|x86.Build.0 = Debug|Any CPU
{562E5DB9-761B-4DE9-98CB-C364F6DE558E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{562E5DB9-761B-4DE9-98CB-C364F6DE558E}.Release|Any CPU.Build.0 = Release|Any CPU
{562E5DB9-761B-4DE9-98CB-C364F6DE558E}.Release|x64.ActiveCfg = Release|Any CPU
{562E5DB9-761B-4DE9-98CB-C364F6DE558E}.Release|x64.Build.0 = Release|Any CPU
{562E5DB9-761B-4DE9-98CB-C364F6DE558E}.Release|x86.ActiveCfg = Release|Any CPU
{562E5DB9-761B-4DE9-98CB-C364F6DE558E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -759,7 +824,15 @@ Global
{4A7305AE-AAAE-43AE-AAB2-DA58DACC6FA8} = {EFF7632B-821E-4CFC-B4A0-ED4B24296B17}
{5A69FD28-D814-490E-A76B-B0A5F88C25B2} = {EFF7632B-821E-4CFC-B4A0-ED4B24296B17}
{8E7BECBC-7226-4778-B8F2-8EBDFF0D3BA4} = {EFF7632B-821E-4CFC-B4A0-ED4B24296B17}

{21303FBF-2A2B-17C2-D2DF-3E924022E940} = {8AFC9781-F6F1-4696-BB4A-9ED7CA9D612B}
{C6DC28DC-95CE-42DA-B02C-FFB2BA1CB1A2} = {21303FBF-2A2B-17C2-D2DF-3E924022E940}
{D4587EC0-1B16-8420-7502-A967139249D4} = {1C217BB2-CE16-41CC-9D47-0FC0DB60BDB3}
{53193780-CD18-2643-6953-C26F59EAEDF5} = {5B448FF6-EC42-491D-A22E-1DC8B618E6D5}
{00205C88-F000-28F2-A910-C6FA00E065EE} = {E5637F81-2FB9-4CD7-900D-455363B142A7}
{4D50F5B2-4782-486F-A9AA-073D798CC60D} = {00205C88-F000-28F2-A910-C6FA00E065EE}
{5BD6F026-413E-9AC5-D159-8E8D9F26EF1B} = {EFF7632B-821E-4CFC-B4A0-ED4B24296B17}
{4535F88F-EA1C-4C6F-84D5-93535EE1568C} = {5BD6F026-413E-9AC5-D159-8E8D9F26EF1B}
{562E5DB9-761B-4DE9-98CB-C364F6DE558E} = {5BD6F026-413E-9AC5-D159-8E8D9F26EF1B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AB41CB55-35EA-4986-A522-387AB3402E71}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ The Durable Task Scheduler for Azure Functions is a managed backend that is curr

This SDK can also be used with the Durable Task Scheduler directly, without any Durable Functions dependency. To get started, sign up for the [Durable Task Scheduler private preview](https://techcommunity.microsoft.com/blog/appsonazureblog/announcing-limited-early-access-of-the-durable-task-scheduler-for-azure-durable-/4286526) and follow the instructions to create a new Durable Task Scheduler instance. Once granted access to the private preview GitHub repository, you can find samples and documentation for getting started [here](https://github.com/Azure/Azure-Functions-Durable-Task-Scheduler-Private-Preview/tree/main/samples/portable-sdk/dotnet/AspNetWebApp#readme).

The [serverless activities sample](samples/serverless/README.md) shows how to declare selected activities for DTS-managed serverless execution and build the remote worker container image separately from the declarer app.

## Obtaining the Protobuf definitions

This project utilizes protobuf definitions from [durabletask-protobuf](https://github.com/microsoft/durabletask-protobuf), which are copied (vendored) into this repository under the `src/Grpc` directory. See the corresponding [README.md](./src/Grpc/README.md) for more information about how to update the protobuf definitions.
Expand Down
57 changes: 57 additions & 0 deletions samples/serverless/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Serverless Activities Sample

This sample shows how to run selected Durable Task activities in DTS-managed serverless sandboxes.

The sample is intentionally split into two projects:

| Path | Purpose |
| --- | --- |
| `main-app/` | Runs locally or in a normal app host. It declares the serverless activity and starts one hello orchestration. |
| `remote-worker/` | Builds the container image that DTS starts inside a serverless sandbox. It contains the remote hello activity. |

## Build

```powershell
dotnet build .\samples\serverless\main-app\main-app.csproj
dotnet build .\samples\serverless\remote-worker\remote-worker.csproj
```

## Build the remote worker image

Run from the repository root:

```powershell
$image = "<acr-name>.azurecr.io/dts-serverless-sample:<tag>"
docker build -f .\samples\serverless\remote-worker\Containerfile -t $image .
docker push $image
```

## Run a hello orchestration

The main app uses `DefaultAzureCredential`; sign in with Azure CLI or configure another supported Azure identity before running it.

```powershell
$env:DTS_ENDPOINT = "https://<scheduler-endpoint>"
$env:DTS_TASK_HUB = "<task-hub>"
$env:DTS_SERVERLESS_ACTIVITY_IMAGE = "<acr-name>.azurecr.io/dts-serverless-sample:<tag>"
$env:DTS_SERVERLESS_CPU = "1000m"
$env:DTS_SERVERLESS_MEMORY = "2048Mi"
$env:DTS_SERVERLESS_MAX_ACTIVITIES = "1"
$env:DTS_SAMPLE_HELLO_INPUT = "serverless-sample"

dotnet run --project .\samples\serverless\main-app\main-app.csproj
```

Expected output includes the serverless activity result:

```text
Runtime status: Completed
Output: "hello from <sandbox> pid=<pid>: serverless-sample"
```

Use the Durable Task Scheduler dashboard's Serverless Activities preview tab to inspect serverless activity runtimes and stream runtime logs.

The remote worker image does not need customer-provided DTS runtime settings.
DTS injects the scheduler endpoint, task hub, worker profile, capacity, substrate,
and sandbox identifier when it starts the sandbox. The worker reports the
activities registered in the image when it connects.
10 changes: 10 additions & 0 deletions samples/serverless/main-app/Activities.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

namespace Microsoft.DurableTask.Samples.Serverless.MainApp;

internal static class ServerlessTaskNames
{
public const string RemoteHello = "RemoteHello";
public const string HelloOrchestrator = nameof(HelloOrchestrator);
}
16 changes: 16 additions & 0 deletions samples/serverless/main-app/Orchestrators.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using Microsoft.DurableTask;

namespace Microsoft.DurableTask.Samples.Serverless.MainApp;

[DurableTask(nameof(HelloOrchestrator))]
internal sealed class HelloOrchestrator : TaskOrchestrator<string, string>
{
public override async Task<string> RunAsync(TaskOrchestrationContext context, string input)
{
string remoteResult = await context.CallActivityAsync<string>(ServerlessTaskNames.RemoteHello, input);
return remoteResult;
}
}
114 changes: 114 additions & 0 deletions samples/serverless/main-app/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using Azure.Core;
using Azure.Identity;
using Microsoft.DurableTask;
using Microsoft.DurableTask.Client;
using Microsoft.DurableTask.Client.AzureManaged;
using Microsoft.DurableTask.Samples.Serverless.MainApp;
using Microsoft.DurableTask.Worker;
using Microsoft.DurableTask.Worker.AzureManaged;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

string endpoint = GetRequiredEnvironmentVariable("DTS_ENDPOINT");
string taskHub = Environment.GetEnvironmentVariable("DTS_TASK_HUB") ?? "ServerlessPocHub";
string workerProfileId = Environment.GetEnvironmentVariable("DTS_WORKER_PROFILE_ID") ?? "default";
string serverlessActivityImage = Environment.GetEnvironmentVariable("DTS_SERVERLESS_ACTIVITY_IMAGE")
?? "serverless-remote-worker:local";
string helloInput = ParseHelloInput(
args,
Environment.GetEnvironmentVariable("DTS_SAMPLE_HELLO_INPUT") ?? "serverless-sample");
TokenCredential credential = new DefaultAzureCredential();

HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
builder.Logging.AddSimpleConsole(options =>
{
options.SingleLine = true;
options.UseUtcTimestamp = true;
options.TimestampFormat = "yyyy-MM-ddTHH:mm:ss.fffZ ";
});

builder.Services.AddDurableTaskWorker(workerBuilder =>
{
workerBuilder.AddTasks(tasks => tasks.AddAllGeneratedTasks());
workerBuilder.UseDurableTaskScheduler(options =>
{
options.EndpointAddress = endpoint;
options.TaskHubName = taskHub;
options.Credential = credential;
});

workerBuilder.DeclareServerlessActivities(options =>
{
options.TaskHub = taskHub;
options.WorkerProfileId = workerProfileId;
options.ContainerImage = serverlessActivityImage;
options.Cpu = Environment.GetEnvironmentVariable("DTS_SERVERLESS_CPU") ?? "1000m";
options.Memory = Environment.GetEnvironmentVariable("DTS_SERVERLESS_MEMORY") ?? "2048Mi";
options.MaxConcurrentActivities = GetIntEnv("DTS_SERVERLESS_MAX_ACTIVITIES", 1);
options.AddActivity(ServerlessTaskNames.RemoteHello);
});
});

builder.Services.AddDurableTaskClient(clientBuilder =>
{
clientBuilder.UseDurableTaskScheduler(options =>
{
options.EndpointAddress = endpoint;
options.TaskHubName = taskHub;
options.Credential = credential;
});
});

using IHost host = builder.Build();

await host.StartAsync();

DurableTaskClient client = host.Services.GetRequiredService<DurableTaskClient>();
string instanceId = await client.ScheduleNewOrchestrationInstanceAsync(
ServerlessTaskNames.HelloOrchestrator,
input: helloInput);
OrchestrationMetadata? result = await client.WaitForInstanceCompletionAsync(
instanceId,
getInputsAndOutputs: true);

Console.WriteLine($"Started orchestration: {instanceId}");
Console.WriteLine($"Runtime status: {result?.RuntimeStatus}");
Console.WriteLine($"Output: {result?.SerializedOutput ?? "<null>"}");

await host.StopAsync();

static string GetRequiredEnvironmentVariable(string name)
=> Environment.GetEnvironmentVariable(name)
?? throw new InvalidOperationException($"An environment variable named '{name}' is required.");

static int GetIntEnv(string name, int defaultValue)
{
string? value = Environment.GetEnvironmentVariable(name);
if (string.IsNullOrWhiteSpace(value))
{
return defaultValue;
}

return int.TryParse(value, out int parsed) && parsed > 0
? parsed
: throw new InvalidOperationException($"Environment variable '{name}' must be a positive integer.");
}

static string ParseHelloInput(string[] args, string defaultHelloInput)
{
if (args.Length == 0)
{
return defaultHelloInput;
}

string verb = args[0].ToLowerInvariant();
return verb switch
{
"hello" => args.Length > 1 ? args[1] : defaultHelloInput,
_ => throw new InvalidOperationException("Supported commands: hello [name]."),
};
}
24 changes: 24 additions & 0 deletions samples/serverless/main-app/main-app.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<AssemblyName>ServerlessMainApp</AssemblyName>
<RootNamespace>Microsoft.DurableTask.Samples.Serverless.MainApp</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" />
<PackageReference Include="Microsoft.Extensions.Hosting" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(SrcRoot)Client/AzureManaged/Client.AzureManaged.csproj" />
<ProjectReference Include="$(SrcRoot)Worker/AzureManaged/Worker.AzureManaged.csproj" />
<ProjectReference Include="$(SrcRoot)Extensions/AzureManagedServerless/AzureManagedServerless.csproj" />
<ProjectReference Include="$(SrcRoot)Analyzers/Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="$(SrcRoot)Generators/Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

</Project>
13 changes: 13 additions & 0 deletions samples/serverless/remote-worker/Activities.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using Microsoft.DurableTask;

namespace Microsoft.DurableTask.Samples.Serverless.RemoteWorker;

[DurableTask("RemoteHello")]
internal sealed class RemoteHelloActivity : TaskActivity<string, string>
{
public override Task<string> RunAsync(TaskActivityContext context, string input)
=> Task.FromResult($"hello from {Environment.MachineName} pid={Environment.ProcessId}: {input}");
}
34 changes: 34 additions & 0 deletions samples/serverless/remote-worker/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# syntax=docker/dockerfile:1.7

FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
ARG TARGETARCH

COPY . /src/durabletask-dotnet

WORKDIR /src/durabletask-dotnet/samples/serverless/remote-worker
RUN case "$TARGETARCH" in \
amd64) runtime_identifier=linux-x64 ;; \
arm64) runtime_identifier=linux-arm64 ;; \
*) echo "Unsupported target architecture: $TARGETARCH" >&2; exit 1 ;; \
esac \
&& dotnet publish remote-worker.csproj \
-c Release \
-r "$runtime_identifier" \
--self-contained false \
-o /app/publish \
--configfile /src/durabletask-dotnet/nuget.config \
/p:DebugSymbols=false \
/p:DebugType=None \
&& find /app/publish -type f \( -name '*.xml' -o -name '*.pdb' \) -delete

FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app

ENV ASPNETCORE_URLS=http://+:8080

EXPOSE 8080

COPY --from=build /app/publish ./

ENTRYPOINT ["dotnet", "ServerlessRemoteWorker.dll"]
Loading
Loading