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 }