Skip to content

Commit

Permalink
Fixed Blob connection bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kmavrodis committed Sep 25, 2024
1 parent becf5fc commit a7436a5
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,8 @@ resource functionApp 'Microsoft.Web/sites@2021-03-01' = {
alwaysOn: true
appSettings: [
{
name: 'AzureWebJobsStorage__accountName'
value: storageAccount.name
}
name: 'AzureWebJobsStorage'
value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};AccountKey=${listKeys(storageAccount.id, storageAccount.apiVersion).keys[0].value};EndpointSuffix=core.windows.net' }
{
name: 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING'
value: 'DefaultEndpointsProtocol=https;AccountName=${functionAppStorage.name};AccountKey=${listKeys(functionAppStorage.id, functionAppStorage.apiVersion).keys[0].value};EndpointSuffix=core.windows.net'
Expand Down Expand Up @@ -320,16 +319,6 @@ resource functionApp 'Microsoft.Web/sites@2021-03-01' = {
}
}

// Role assignments for the Function App's managed identity
resource functionAppStorageBlobDataContributorRole 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
name: guid(functionApp.id, storageAccount.id, 'StorageBlobDataContributor')
scope: storageAccount
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'ba92f5b4-2d11-453d-a403-e96b0029c9fe') // Storage Blob Data Contributor
principalId: functionApp.identity.principalId
principalType: 'ServicePrincipal'
}
}

// Cosmos DB role assignment
resource cosmosDBDataContributorRoleDefinition 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions@2021-04-15' existing = {
Expand Down

0 comments on commit a7436a5

Please sign in to comment.