Skip to content

Commit c4f9952

Browse files
committed
fix: add missing storage for functions
1 parent bdd609c commit c4f9952

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

infra/core/host/functions.bicep

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ param applicationInsightsName string = ''
88
param appServicePlanId string
99
param keyVaultName string = ''
1010
param managedIdentity bool = !empty(keyVaultName)
11+
param storageAccountName string
1112

1213
// Runtime Properties
1314
@allowed([
@@ -54,7 +55,7 @@ module functions 'appservice.bicep' = {
5455
applicationInsightsName: applicationInsightsName
5556
appServicePlanId: appServicePlanId
5657
appSettings: union(appSettings, {
57-
AzureWebJobsStorage: ''
58+
AzureWebJobsStorage: 'DefaultEndpointsProtocol=https;AccountName=${storage.name};AccountKey=${storage.listKeys().keys[0].value};EndpointSuffix=${environment().suffixes.storage}'
5859
FUNCTIONS_EXTENSION_VERSION: extensionVersion
5960
FUNCTIONS_WORKER_RUNTIME: runtimeName
6061
})
@@ -76,6 +77,10 @@ module functions 'appservice.bicep' = {
7677
}
7778
}
7879

80+
resource storage 'Microsoft.Storage/storageAccounts@2021-09-01' existing = {
81+
name: storageAccountName
82+
}
83+
7984
output identityPrincipalId string = managedIdentity ? functions.outputs.identityPrincipalId : ''
8085
output name string = functions.outputs.name
8186
output uri string = functions.outputs.uri

infra/main.bicep

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ param webappLocation string // Set in main.parameters.json
1919
// Azure OpenAI -- Cognitive Services
2020
param assistantId string = '' // Set in main.parameters.json
2121

22+
param blobContainerName string = 'files'
23+
2224
var assistantGpt = {
2325
modelName: 'gpt-35-turbo'
2426
deploymentName: 'gpt-35-turbo'
@@ -71,6 +73,7 @@ module api './core/host/functions.bicep' = {
7173
runtimeName: 'node'
7274
runtimeVersion: '20'
7375
appServicePlanId: appServicePlan.outputs.id
76+
storageAccountName: storage.outputs.name
7477
managedIdentity: true
7578
appSettings: {
7679
AZURE_OPENAI_ENDPOINT: finalOpenAiUrl
@@ -105,7 +108,12 @@ module storage './core/storage/storage-account.bicep' = {
105108
location: location
106109
tags: tags
107110
allowBlobPublicAccess: false
108-
containers: []
111+
containers: [
112+
{
113+
name: blobContainerName
114+
publicAccess: 'None'
115+
}
116+
]
109117
}
110118
}
111119

0 commit comments

Comments
 (0)