Skip to content

Commit

Permalink
🩹 Fixes Blazor SSR Deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
xxnickles committed Feb 3, 2024
1 parent 617e217 commit a67a449
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/amf-ssr-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ jobs:
run: echo "AZURE_WEBAPP_NAME=${{ steps.infrastructure.outputs.appname }}" >> $GITHUB_ENV

# Setup node.js for tailwind
- name: Setup Node ${{ env.NODE_VERSION }}
- name: Setup Node lts
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version: lts

- name: "npm install, build, and test"
run: |
Expand Down
42 changes: 18 additions & 24 deletions deployment/blazor-app.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,27 @@ var webAppHostingPlanName = 'afm-blazor-hosting-plan'
var keyVaultName = 'afm-key-vault'
var managedIdentityName = 'afm-managed-identity'

resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' existing = {
name: storageAccountName
scope: resourceGroup()
}

resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' existing = {
name: managedIdentityName
location: location
}

// Create the role assignments for Azure Storage

var roleDefinitionIds = [
'974c5e8b-45b9-4653-ba55-5f855dd0fb88' //Storage Queue Data Contributor
'0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa' //Storage Table Data Contributor
'ba92f5b4-2d11-453d-a403-e96b0029c9fe' //Storage Blob Data Contributor
]

resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for roleDefinitionId in roleDefinitionIds: {
scope: storageAccount
name: guid(storageAccount.id, managedIdentity.id, roleDefinitionId)
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId)
principalId: managedIdentity.id
principalType: managedIdentity.type
}
}]
// Create the role assignments for Azure Storage. Doesn't work as you will need to have some werid permisions

// var roleDefinitionIds = [
// '974c5e8b-45b9-4653-ba55-5f855dd0fb88' //Storage Queue Data Contributor
// '0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa' //Storage Table Data Contributor
// 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' //Storage Blob Data Contributor
// ]

// resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [for roleDefinitionId in roleDefinitionIds: {
// scope: storageAccount
// name: guid(storageAccount.id, managedIdentity.id, roleDefinitionId)
// properties: {
// roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', roleDefinitionId)
// principalId: managedIdentity.id
// principalType: managedIdentity.type
// }
// }]



Expand Down

0 comments on commit a67a449

Please sign in to comment.