Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 1 addition & 1 deletion infra/core/host/container-apps-auth.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ resource auth 'Microsoft.App/containerApps/authConfigs@2024-10-02-preview' = {
}
}
login: {
// https://learn.microsoft.com/en-us/azure/container-apps/token-store
// https://learn.microsoft.com/azure/container-apps/token-store
tokenStore: {
enabled: true
azureBlobStorage: {
Expand Down
23 changes: 17 additions & 6 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ module storageRoleUser 'core/security/role.bicep' = {
name: 'storage-role-user'
params: {
principalId: principalId
roleDefinitionId: '2a2b9908-6ea1-4ae2-8e65-a410df84e7d1'
roleDefinitionId: '2a2b9908-6ea1-4ae2-8e65-a410df84e7d1' // Storage Blob Data Reader
principalType: principalType
}
}
Expand All @@ -982,7 +982,7 @@ module storageContribRoleUser 'core/security/role.bicep' = {
name: 'storage-contrib-role-user'
params: {
principalId: principalId
roleDefinitionId: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe'
roleDefinitionId: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' // Storage Blob Data Contributor
principalType: principalType
}
}
Expand All @@ -992,7 +992,7 @@ module storageOwnerRoleUser 'core/security/role.bicep' = if (useUserUpload) {
name: 'storage-owner-role-user'
params: {
principalId: principalId
roleDefinitionId: 'b7e6dc6d-f1e8-4753-8033-0f276bb0955b'
roleDefinitionId: 'b7e6dc6d-f1e8-4753-8033-0f276bb0955b' // Storage Blob Data Owner
principalType: principalType
}
}
Expand Down Expand Up @@ -1092,7 +1092,7 @@ module storageRoleBackend 'core/security/role.bicep' = {
principalId: (deploymentTarget == 'appservice')
? backend.outputs.identityPrincipalId
: acaBackend.outputs.identityPrincipalId
roleDefinitionId: '2a2b9908-6ea1-4ae2-8e65-a410df84e7d1'
roleDefinitionId: '2a2b9908-6ea1-4ae2-8e65-a410df84e7d1' // Storage Blob Data Reader
principalType: 'ServicePrincipal'
}
}
Expand All @@ -1104,7 +1104,7 @@ module storageOwnerRoleBackend 'core/security/role.bicep' = if (useUserUpload) {
principalId: (deploymentTarget == 'appservice')
? backend.outputs.identityPrincipalId
: acaBackend.outputs.identityPrincipalId
roleDefinitionId: 'b7e6dc6d-f1e8-4753-8033-0f276bb0955b'
roleDefinitionId: 'b7e6dc6d-f1e8-4753-8033-0f276bb0955b' // Storage Blob Data Owner
principalType: 'ServicePrincipal'
}
}
Expand All @@ -1114,7 +1114,7 @@ module storageRoleSearchService 'core/security/role.bicep' = if (useIntegratedVe
name: 'storage-role-searchservice'
params: {
principalId: searchService.outputs.principalId
roleDefinitionId: '2a2b9908-6ea1-4ae2-8e65-a410df84e7d1'
roleDefinitionId: '2a2b9908-6ea1-4ae2-8e65-a410df84e7d1' // Storage Blob Data Reader
principalType: 'ServicePrincipal'
}
}
Expand All @@ -1129,6 +1129,17 @@ module storageRoleContributorSearchService 'core/security/role.bicep' = if (useI
}
}

// Necessary for the Container Apps backend to store tokens in the container
module storageRoleContributorBackend 'core/security/role.bicep' = if (deploymentTarget == 'containerapps' && !empty(clientAppId)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: If the user upload feature is also enabled, then the ACA backend will get granted both "Storage Blob Data Owner" and "Storage Blob Data Contributor". That should work fine, even though it's a bit redundant.

scope: storageResourceGroup
name: 'storage-role-contributor-aca-backend'
params: {
principalId: acaBackend.outputs.identityPrincipalId
roleDefinitionId: 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' // Storage Blob Data Contributor
principalType: 'ServicePrincipal'
}
}

// Used to issue search queries
// https://learn.microsoft.com/azure/search/search-security-rbac
module searchRoleBackend 'core/security/role.bicep' = {
Expand Down
Loading