From 5b0ddc9b9afc8717fbba7ef50cbbe4f46a1517b6 Mon Sep 17 00:00:00 2001 From: Garrett Beatty Date: Tue, 7 Jul 2026 16:06:07 -0400 Subject: [PATCH] Set AutoPublishAlias on serverless.DurableFunction blueprint Add AutoPublishAlias: live to the function in the serverless.DurableFunction blueprint (vs2026) so SAM publishes a function version and points the 'live' alias at it on every deploy. Without a published version, invoking a freshly deployed durable function fails with a no-published-version error. --- .../changes/durable-serverless-autopublishalias.json | 11 +++++++++++ .../template/src/BlueprintBaseName.1/Readme.md | 5 +++++ .../src/BlueprintBaseName.1/serverless.template | 1 + 3 files changed, 17 insertions(+) create mode 100644 .autover/changes/durable-serverless-autopublishalias.json diff --git a/.autover/changes/durable-serverless-autopublishalias.json b/.autover/changes/durable-serverless-autopublishalias.json new file mode 100644 index 000000000..bbf6791ba --- /dev/null +++ b/.autover/changes/durable-serverless-autopublishalias.json @@ -0,0 +1,11 @@ +{ + "Projects": [ + { + "Name": "Amazon.Lambda.Templates", + "Type": "Patch", + "ChangelogMessages": [ + "Set AutoPublishAlias to 'live' on the function in the serverless.DurableFunction blueprint (vs2026). SAM now publishes a new function version and points the 'live' alias at it on every deploy, so the durable function can be invoked immediately after deployment instead of failing with a no-published-version error. Preview." + ] + } + ] +} diff --git a/Blueprints/BlueprintDefinitions/vs2026/DurableFunctionServerless/template/src/BlueprintBaseName.1/Readme.md b/Blueprints/BlueprintDefinitions/vs2026/DurableFunctionServerless/template/src/BlueprintBaseName.1/Readme.md index ceca1068c..ad4de1697 100644 --- a/Blueprints/BlueprintDefinitions/vs2026/DurableFunctionServerless/template/src/BlueprintBaseName.1/Readme.md +++ b/Blueprints/BlueprintDefinitions/vs2026/DurableFunctionServerless/template/src/BlueprintBaseName.1/Readme.md @@ -51,6 +51,11 @@ The `[DurableExecution]` attribute drives the source generator, which keeps the dotnet lambda deploy-serverless ``` +The template sets `AutoPublishAlias: live` on the function. On every deploy, SAM publishes a new +function version and points the `live` alias at it, so the function can be invoked immediately after +deployment. Without a published version, invoking a freshly deployed durable function fails because +durable execution requires a specific function version to run against. + ## Invoke CloudFormation generates the deployed function name, so it won't be `BlueprintBaseName.1`. Find it by diff --git a/Blueprints/BlueprintDefinitions/vs2026/DurableFunctionServerless/template/src/BlueprintBaseName.1/serverless.template b/Blueprints/BlueprintDefinitions/vs2026/DurableFunctionServerless/template/src/BlueprintBaseName.1/serverless.template index 71fb20611..b05365082 100644 --- a/Blueprints/BlueprintDefinitions/vs2026/DurableFunctionServerless/template/src/BlueprintBaseName.1/serverless.template +++ b/Blueprints/BlueprintDefinitions/vs2026/DurableFunctionServerless/template/src/BlueprintBaseName.1/serverless.template @@ -21,6 +21,7 @@ ], "PackageType": "Zip", "Handler": "BlueprintBaseName.1::BlueprintBaseName._1.Function_ProcessOrder_Generated::ProcessOrder", + "AutoPublishAlias": "live", "DurableConfig": { "ExecutionTimeout": 86400 }