Skip to content

Commit 7c97bfd

Browse files
committed
Add missing RBAC role when using container apps
1 parent 165dcac commit 7c97bfd

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

infra/core/host/container-apps-auth.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ resource auth 'Microsoft.App/containerApps/authConfigs@2024-10-02-preview' = {
5656
}
5757
}
5858
login: {
59-
// https://learn.microsoft.com/en-us/azure/container-apps/token-store
59+
// https://learn.microsoft.com/azure/container-apps/token-store
6060
tokenStore: {
6161
enabled: true
6262
azureBlobStorage: {

infra/main.bicep

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,17 @@ module storageRoleContributorSearchService 'core/security/role.bicep' = if (useI
11291129
}
11301130
}
11311131

1132+
// Necessary for the Container Apps backend to store tokens in the container
1133+
module storageRoleContributorBackend 'core/security/role.bicep' = if (deploymentTarget == 'containerapps' && !empty(clientAppId)) {
1134+
scope: storageResourceGroup
1135+
name: 'storage-role-contributor-aca-backend'
1136+
params: {
1137+
principalId: acaBackend.outputs.identityPrincipalId
1138+
roleDefinitionId: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' // Storage Blob Data Contributor
1139+
principalType: 'ServicePrincipal'
1140+
}
1141+
}
1142+
11321143
// Used to issue search queries
11331144
// https://learn.microsoft.com/azure/search/search-security-rbac
11341145
module searchRoleBackend 'core/security/role.bicep' = {

0 commit comments

Comments
 (0)