File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Deployment/testFunctions/parts Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,9 @@ resource function 'Microsoft.Web/sites@2024-04-01' = {
7272 name : functionName
7373 location : location
7474 kind : 'functionapp,linux'
75+ identity : {
76+ type : 'SystemAssigned'
77+ }
7578 properties : {
7679 serverFarmId : functionFarm .id
7780 httpsOnly : true
@@ -143,3 +146,16 @@ module configurationRegistration 'configurationRegistration.bicep' = {
143146 sortOrder : sortOrder
144147 }
145148}
149+
150+ var storageRoleDefinitionId = 'b7e6dc6d-f1e8-4753-8033-0f276bb0955b' //Storage Blob Data Owner role
151+
152+ // Allow access from function app to storage account using a managed identity
153+ resource storageRoleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
154+ name : guid (storageAccount .id , storageRoleDefinitionId )
155+ scope : storageAccount
156+ properties : {
157+ roleDefinitionId : resourceId ('Microsoft.Authorization/roleDefinitions' , storageRoleDefinitionId )
158+ principalId : functionFarm .identity .principalId
159+ principalType : 'ServicePrincipal'
160+ }
161+ }
You can’t perform that action at this time.
0 commit comments