Skip to content

Commit bdd609c

Browse files
committed
chore: update bicep config
1 parent 612fc81 commit bdd609c

File tree

7 files changed

+120
-84
lines changed

7 files changed

+120
-84
lines changed

api/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ project.lock.json
2020
/data
2121
.secrets
2222
appsettings.json
23+
local.settings.json
2324

2425
node_modules
2526
dist

api/package-lock.json

Lines changed: 40 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "azure-openai-assistant-javascript-api",
33
"version": "1.0.0",
44
"description": "The API for a personal finance assistant designed to help you with financial tasks and queries.",
5-
"main": "src/functions/assistant.js",
5+
"main": "src/functions/*.js",
66
"scripts": {
77
"start": "func start --cors \"*\" --verbose",
88
"test": "echo \"No tests yet...\""

azure.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ services:
1313
posix:
1414
shell: sh
1515
run: export API_URL && npm run build
16-
# postdeploy:
17-
# shell: sh
18-
# run: azd env get-values > .env && npx swa deploy --deployment-token ${DEPLOYMENT_TOKEN} && npm install --only=dev --prefix api
19-
# interactive: false
20-
# continueOnError: false
2116
api:
2217
project: ./api
2318
language: js

infra/core/host/staticwebapp.bicep

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,6 @@ resource web 'Microsoft.Web/staticSites@2023-01-01' = {
2222
}
2323
}
2424

25-
// resource backendResourceId 'Microsoft.Web/sites@2021-03-01' existing = {
26-
// name: name
27-
// scope: resourceGroup(rg)
28-
// }
29-
30-
// resource swamv_ui_backend_functions 'Microsoft.Web/staticSites/linkedBackends@2022-03-01' = {
31-
// parent: web
32-
// name: 'swa_backend_functions'
33-
// properties: {
34-
// backendResourceId: backendResourceId.id
35-
// region: location
36-
// }
37-
// }
38-
3925
output name string = web.name
4026
output uri string = 'https://${web.properties.defaultHostname}'
4127
output identityPrincipalId string = web.identity.principalId
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
metadata description = 'Creates an Azure storage account.'
2+
param name string
3+
param location string = resourceGroup().location
4+
param tags object = {}
5+
6+
@allowed([
7+
'Cool'
8+
'Hot'
9+
'Premium' ])
10+
param accessTier string = 'Hot'
11+
param allowBlobPublicAccess bool = true
12+
param allowCrossTenantReplication bool = true
13+
param allowSharedKeyAccess bool = true
14+
param containers array = []
15+
param defaultToOAuthAuthentication bool = false
16+
param deleteRetentionPolicy object = {}
17+
@allowed([ 'AzureDnsZone', 'Standard' ])
18+
param dnsEndpointType string = 'Standard'
19+
param kind string = 'StorageV2'
20+
param minimumTlsVersion string = 'TLS1_2'
21+
param supportsHttpsTrafficOnly bool = true
22+
param networkAcls object = {
23+
bypass: 'AzureServices'
24+
defaultAction: 'Allow'
25+
}
26+
@allowed([ 'Enabled', 'Disabled' ])
27+
param publicNetworkAccess string = 'Enabled'
28+
param sku object = { name: 'Standard_LRS' }
29+
30+
resource storage 'Microsoft.Storage/storageAccounts@2022-05-01' = {
31+
name: name
32+
location: location
33+
tags: tags
34+
kind: kind
35+
sku: sku
36+
properties: {
37+
accessTier: accessTier
38+
allowBlobPublicAccess: allowBlobPublicAccess
39+
allowCrossTenantReplication: allowCrossTenantReplication
40+
allowSharedKeyAccess: allowSharedKeyAccess
41+
defaultToOAuthAuthentication: defaultToOAuthAuthentication
42+
dnsEndpointType: dnsEndpointType
43+
minimumTlsVersion: minimumTlsVersion
44+
networkAcls: networkAcls
45+
publicNetworkAccess: publicNetworkAccess
46+
supportsHttpsTrafficOnly: supportsHttpsTrafficOnly
47+
}
48+
49+
resource blobServices 'blobServices' = if (!empty(containers)) {
50+
name: 'default'
51+
properties: {
52+
deleteRetentionPolicy: deleteRetentionPolicy
53+
}
54+
resource container 'containers' = [for container in containers: {
55+
name: container.name
56+
properties: {
57+
publicAccess: contains(container, 'publicAccess') ? container.publicAccess : 'None'
58+
}
59+
}]
60+
}
61+
}
62+
63+
output name string = storage.name
64+
output primaryEndpoints object = storage.properties.primaryEndpoints

infra/main.bicep

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ param resourceGroupName string = ''
1313
param webappName string = 'webapp'
1414
param apiServiceName string = 'api'
1515
param appServicePlanName string = ''
16+
param storageAccountName string = ''
1617
param webappLocation string // Set in main.parameters.json
1718

1819
// Azure OpenAI -- Cognitive Services
@@ -96,6 +97,18 @@ module appServicePlan './core/host/appserviceplan.bicep' = {
9697
}
9798
}
9899

100+
module storage './core/storage/storage-account.bicep' = {
101+
name: 'storage'
102+
scope: resourceGroup
103+
params: {
104+
name: !empty(storageAccountName) ? storageAccountName : '${abbrs.storageStorageAccounts}${resourceToken}'
105+
location: location
106+
tags: tags
107+
allowBlobPublicAccess: false
108+
containers: []
109+
}
110+
}
111+
99112
module openAi 'core/ai/cognitiveservices.bicep' = if (empty(openAiUrl)) {
100113
name: 'openai'
101114
scope: resourceGroup
@@ -162,3 +175,4 @@ output OPENAI_API_VERSION string = openAiApiVersion
162175
output WEBAPP_URL string = webapp.outputs.uri
163176
output API_URL string = api.outputs.uri
164177

178+
output OPENAI_FUNCTION_CALLING_SKIP_SEND_EMAIL string = OPENAI_FUNCTION_CALLING_SKIP_SEND_EMAIL

0 commit comments

Comments
 (0)