Skip to content

Commit 092ab22

Browse files
authored
Fix antiforgery token errors by restoring autoConfigureDataProtection in Azure Container Apps (#804)
### Summary & Motivation Upgrade the Azure Container Apps API version from `2025-07-01` (stable) to `2025-10-02-preview` to restore the `autoConfigureDataProtection` runtime setting for .NET containers. When upgrading to the stable `2025-07-01` API version in PR #793, the `autoConfigureDataProtection` feature was inadvertently lost because it remains a preview-only feature not included in stable releases. This change reverts to a preview API version that supports this feature, which enables automatic configuration of ASP.NET Data Protection keys across all container apps in an environment - essential for antiforgery token validation when multiple container apps (AppGateway, account-management, back-office, etc.) need to share encrypted tokens. The learning here is that stable API versions may not include all preview features that the infrastructure depends on. When upgrading API versions, verify that preview features are still available or consciously choose to remain on a preview version until the required features become stable. ### Checklist - [x] I have added tests, or done manual regression tests - [x] I have updated the documentation, if necessary
2 parents 519753f + 6cc115f commit 092ab22

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cloud-infrastructure/modules/container-app.bicep

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var image = useQuickStartImage
6060
// Create a revisionSuffix that contains the version and random suffix. E.g. "2025-11-19-756-a3f2"
6161
var fullRevisionSuffix = '${replace(containerImageTag, '.', '-')}-${revisionSuffix}'
6262

63-
resource containerApp 'Microsoft.App/containerApps@2025-07-01' = {
63+
resource containerApp 'Microsoft.App/containerApps@2025-10-02-preview' = {
6464
name: name
6565
location: location
6666
tags: tags
@@ -149,6 +149,11 @@ resource containerApp 'Microsoft.App/containerApps@2025-07-01' = {
149149
identity: userAssignedIdentity.id
150150
}
151151
]
152+
runtime: {
153+
dotnet: {
154+
autoConfigureDataProtection: true
155+
}
156+
}
152157
ingress: ingress
153158
? {
154159
external: external

0 commit comments

Comments
 (0)